Merge pull request #1557 from mjkillough/issue_1366

Add test for issue #1366.
This commit is contained in:
Nick Cameron 2017-05-17 09:58:49 +12:00 committed by GitHub
commit 15323fc38b
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,12 @@
fn main() {
fn f() -> Option<i32> {
Some("fffffffsssssssssddddssssfffffddddff").map(|s| s).map(|s| s.to_string()).map(|res| {
match Some(res) {
Some(ref s) if s == "" => 41,
Some(_) => 42,
_ => 43,
}
})
}
println!("{:?}", f())
}

View File

@ -0,0 +1,13 @@
fn main() {
fn f() -> Option<i32> {
Some("fffffffsssssssssddddssssfffffddddff")
.map(|s| s)
.map(|s| s.to_string())
.map(|res| match Some(res) {
Some(ref s) if s == "" => 41,
Some(_) => 42,
_ => 43,
})
}
println!("{:?}", f())
}