Compare commits
No commits in common. "019fbcf09591da228c43f2990ec8a6c03eae252f" and "04520ffa1e9dbadcda45edb6b9c30264d308b9cd" have entirely different histories.
019fbcf095
...
04520ffa1e
15
src/main.rs
15
src/main.rs
@ -1,14 +1,5 @@
|
|||||||
fn add_10(value: Option<u32>) -> Result<u32, String> {
|
fn main() {
|
||||||
match value {
|
for value in (-10..10).rev() {
|
||||||
Some(v) => Ok(v + 10),
|
println!("Value: {}", value);
|
||||||
None => Err(String::from("value was empty")),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let value = add_10(None);
|
|
||||||
|
|
||||||
println!("Result is: {}", value.unwrap_or(42));
|
|
||||||
|
|
||||||
panic!("Non recoverable error.");
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user