]> git.lizzy.rs Git - rust.git/blob - tests/ui/unwrap.rs
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / unwrap.rs
1 #![warn(clippy::unwrap_used)]
2
3 fn unwrap_option() {
4     let opt = Some(0);
5     let _ = opt.unwrap();
6 }
7
8 fn unwrap_result() {
9     let res: Result<u8, u8> = Ok(0);
10     let _ = res.unwrap();
11     let _ = res.unwrap_err();
12 }
13
14 fn main() {
15     unwrap_option();
16     unwrap_result();
17 }