]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/needless_return.rs
Merge branch 'master' into hooks
[rust.git] / src / tools / clippy / tests / ui / needless_return.rs
index af0cdfb207ff568f9e0cbc29225437196be17868..29f2bd1852af00e9f1df68916f1f7624046e4c93 100644 (file)
@@ -69,6 +69,23 @@ fn test_void_match(x: u32) {
     }
 }
 
+fn read_line() -> String {
+    use std::io::BufRead;
+    let stdin = ::std::io::stdin();
+    return stdin.lock().lines().next().unwrap().unwrap();
+}
+
+fn borrows_but_not_last(value: bool) -> String {
+    if value {
+        use std::io::BufRead;
+        let stdin = ::std::io::stdin();
+        let _a = stdin.lock().lines().next().unwrap().unwrap();
+        return String::from("test");
+    } else {
+        return String::new();
+    }
+}
+
 fn main() {
     let _ = test_end_of_fn();
     let _ = test_no_semicolon();