Add test
This commit is contained in:
parent
50ecd595a6
commit
41eba2f26a
@ -19,3 +19,7 @@ pub fn foo() -> Option<String> {
|
||||
let x = Some(String::from("hello"));
|
||||
Some("hello".to_owned()).and_then(|s| Some(format!("{}{}", s, x?)))
|
||||
}
|
||||
|
||||
pub fn example2(x: bool) -> Option<&'static str> {
|
||||
Some("a").and_then(|s| Some(if x { s } else { return None }))
|
||||
}
|
||||
|
@ -19,3 +19,7 @@ pub fn foo() -> Option<String> {
|
||||
let x = Some(String::from("hello"));
|
||||
Some("hello".to_owned()).and_then(|s| Some(format!("{}{}", s, x?)))
|
||||
}
|
||||
|
||||
pub fn example2(x: bool) -> Option<&'static str> {
|
||||
Some("a").and_then(|s| Some(if x { s } else { return None }))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user