]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unwrap.rs
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / 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, ()> = Ok(0);
10     let _ = res.unwrap();
11 }
12
13 fn main() {
14     unwrap_option();
15     unwrap_result();
16 }