]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/needless_return.rs
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / src / tools / clippy / tests / ui / needless_return.rs
index e1a1bea2c0b85f19f769a4c4ea0b904d348f4cf9..abed338bb9b297c415a2cf0115728cd54e6f29a5 100644 (file)
@@ -287,4 +287,14 @@ fn issue9947() -> Result<(), String> {
     do yeet "hello";
 }
 
+// without anyhow, but triggers the same bug I believe
+#[expect(clippy::useless_format)]
+fn issue10051() -> Result<String, String> {
+    if true {
+        return Ok(format!("ok!"));
+    } else {
+        return Err(format!("err!"));
+    }
+}
+
 fn main() {}