4 fn option_unwrap_or() {
60 // cases where the none arm isn't a constant expression
61 // are not linted due to potential ownership issues
63 // ownership issue example, don't lint
65 let mut option: Option<NonCopyable> = None;
69 option = Some(NonCopyable);
75 // ownership issue example, don't lint
76 let option: Option<&str> = None;
79 None => &format!("{} {}!", "hello", "world"),
83 fn result_unwrap_or() {
85 match Ok(1) as Result<i32, &str> {
91 match Ok(1) as Result<i32, &str> {
97 match Ok(1) as Result<i32, &str> {
104 match Ok(1) as Result<i32, &str> {
114 match Ok("Bob") as Result<&str, &str> {
120 match Ok(1) as Result<i32, &str> {
124 match Ok(1) as Result<i32, &str> {
129 match Ok(j) as Result<i32, &str> {
133 match Ok(j) as Result<i32, &str> {