mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-06 18:59:19 +00:00
if complete
This commit is contained in:
parent
a54818ef45
commit
a7281c3016
7
.vs/VSWorkspaceState.json
Normal file
7
.vs/VSWorkspaceState.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\C:\\Users\\artur\\Source\\Repos\\rustlings",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
BIN
.vs/rustlings/v17/.suo
Normal file
BIN
.vs/rustlings/v17/.suo
Normal file
Binary file not shown.
@ -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 :)
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user