From 4dfc11d74ab02ac5765ae5d08fb750c91f4744b4 Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Fri, 2 Oct 2026 21:53:51 -0500 Subject: rustlings: move to rust/ --- rustlings/exercises/09_strings/strings4.rs | 37 ------------------------------ 1 file changed, 37 deletions(-) delete mode 100644 rustlings/exercises/09_strings/strings4.rs (limited to 'rustlings/exercises/09_strings/strings4.rs') diff --git a/rustlings/exercises/09_strings/strings4.rs b/rustlings/exercises/09_strings/strings4.rs deleted file mode 100644 index 3f7c5e7..0000000 --- a/rustlings/exercises/09_strings/strings4.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Calls of this function should be replaced with calls of `string_slice` or `string`. -fn placeholder() {} - -fn string_slice(arg: &str) { - println!("{arg}"); -} - -fn string(arg: String) { - println!("{arg}"); -} - -// TODO: Here are a bunch of values - some are `String`, some are `&str`. -// Your task is to replace `placeholder(…)` with either `string_slice(…)` -// or `string(…)` depending on what you think each value is. -fn main() { - string_slice("blue"); - - string("red".to_string()); - - string(String::from("hi")); - - string("rust is fun!".to_owned()); - - string("nice weather".into()); - - string(format!("Interpolation {}", "Station")); - - // WARNING: This is byte indexing, not character indexing. - // Character indexing can be done using `s.chars().nth(INDEX)`. - string_slice(&String::from("abc")[0..1]); - - string_slice(" hello there ".trim()); - - string("Happy Monday!".replace("Mon", "Tues")); - - string("mY sHiFt KeY iS sTiCkY".to_lowercase()); -} -- cgit v1.2.3