]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unwrap.rs
Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31
[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 }