]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/or_fun_call.fixed
iterate List by value
[rust.git] / tests / ui / or_fun_call.fixed
index 198d9862e3f72c168ec6bfd252a117247734dc03..8ea03fe42616c3339b09befee410f49e71fcd30a 100644 (file)
@@ -53,9 +53,7 @@ fn or_fun_call() {
     with_default_type.unwrap_or_default();
 
     let with_vec = Some(vec![1]);
-    with_vec.unwrap_or_else(|| vec![]);
-
-    // FIXME #944: ~|SUGGESTION with_vec.unwrap_or_else(|| vec![]);
+    with_vec.unwrap_or_default();
 
     let without_default = Some(Foo);
     without_default.unwrap_or_else(Foo::new);
@@ -71,7 +69,7 @@ fn or_fun_call() {
 
     let opt = Some(1);
     let hello = "Hello";
-    let _ = opt.ok_or_else(|| format!("{} world.", hello));
+    let _ = opt.ok_or(format!("{} world.", hello));
 }
 
 struct Foo(u8);