Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystucki committed May 25, 2020
1 parent 6de17b0 commit 6bd9cd9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ui/or_fun_call.rs
Expand Up @@ -95,6 +95,15 @@ fn test_or_with_ctors() {
let b = "b".to_string();
let _ = Some(Bar("a".to_string(), Duration::from_secs(1)))
.or(Some(Bar(b, Duration::from_secs(2))));

let vec = vec!["foo"];
let _ = opt.ok_or(vec.len());

let array = ["foo"];
let _ = opt.ok_or(array.len());

let slice = &["foo"][..];
let _ = opt.ok_or(slice.len());
}

// Issue 4514 - early return
Expand Down

0 comments on commit 6bd9cd9

Please sign in to comment.