summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/expect.rs
blob: 1073acf6f0cd66b51c33588bfa7296e1a9364a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![warn(clippy::expect_used)]

fn expect_option() {
    let opt = Some(0);
    let _ = opt.expect("");
}

fn expect_result() {
    let res: Result<u8, ()> = Ok(0);
    let _ = res.expect("");
}

fn main() {
    expect_option();
    expect_result();
}