diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..b727f6ce --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\C:\\Users\\artur\\Source\\Repos\\rustlings", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/rustlings/v17/.suo b/.vs/rustlings/v17/.suo new file mode 100644 index 00000000..cf023867 Binary files /dev/null and b/.vs/rustlings/v17/.suo differ diff --git a/exercises/03_if/if1.rs b/exercises/03_if/if1.rs index 4734d78f..aae97ab2 100644 --- a/exercises/03_if/if1.rs +++ b/exercises/03_if/if1.rs @@ -2,13 +2,13 @@ // // Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE pub fn bigger(a: i32, b: i32) -> i32 { // Complete this function to return the bigger number! // Do not use: // - another function call // - additional variables + if a > b {return a} else {return b} } // Don't mind this for now :) diff --git a/exercises/03_if/if2.rs b/exercises/03_if/if2.rs index f512f13f..b8a66390 100644 --- a/exercises/03_if/if2.rs +++ b/exercises/03_if/if2.rs @@ -5,13 +5,15 @@ // // Execute `rustlings hint if2` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE + pub fn foo_if_fizz(fizzish: &str) -> &str { if fizzish == "fizz" { "foo" + } else if fizzish == "fuzz" { + "bar" } else { - 1 + "baz" } } diff --git a/exercises/03_if/if3.rs b/exercises/03_if/if3.rs index 16962740..08dff78e 100644 --- a/exercises/03_if/if3.rs +++ b/exercises/03_if/if3.rs @@ -2,21 +2,19 @@ // // Execute `rustlings hint if3` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE - pub fn animal_habitat(animal: &str) -> &'static str { let identifier = if animal == "crab" { 1 } else if animal == "gopher" { - 2.0 + 2 } else if animal == "snake" { 3 } else { - "Unknown" + 0 }; // DO NOT CHANGE THIS STATEMENT BELOW - let habitat = if identifier == 1 { + let habitat = if identifier == 1 { "Beach" } else if identifier == 2 { "Burrow"