]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/unwrap_or.rs
bump version to 1.80.1+dfsg1-1~bpo12+pve1
[rustc.git] / src / tools / clippy / tests / ui / unwrap_or.rs
CommitLineData
487cf647 1#![warn(clippy::all, clippy::or_fun_call)]
fe692bf9 2#![allow(clippy::unnecessary_literal_unwrap)]
f20569fa
XL
3
4fn main() {
5 let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len();
781aab86
FG
6 //~^ ERROR: use of `unwrap_or` followed by a function call
7 //~| NOTE: `-D clippy::or-fun-call` implied by `-D warnings`
f20569fa
XL
8}
9
10fn new_lines() {
11 let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len();
781aab86 12 //~^ ERROR: use of `unwrap_or` followed by a function call
f20569fa 13}