rust-clippy/tests/ui/manual_unwrap_or_default.fixed

20 lines
433 B
Rust
Raw Normal View History

2024-03-10 00:12:15 +00:00
#![warn(clippy::manual_unwrap_or_default)]
#![allow(clippy::unnecessary_literal_unwrap)]
fn main() {
let x: Option<Vec<String>> = None;
x.unwrap_or_default();
let x: Option<Vec<String>> = None;
x.unwrap_or_default();
let x: Option<String> = None;
x.unwrap_or_default();
let x: Option<Vec<String>> = None;
x.unwrap_or_default();
let x: Option<Vec<String>> = None;
x.unwrap_or_default();
}