]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/book/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / doc / book / listings / ch10-generic-types-traits-and-lifetimes / listing-10-23 / src / main.rs
index 836ec7295912ca325497b021c3990919e0b0ded1..2a6fa5898f5b4c8c910444f5975c00382e37e9d0 100644 (file)
@@ -1,12 +1,12 @@
 // ANCHOR: here
 fn main() {
     let string1 = String::from("long string is long");
-
+    let result;
     {
         let string2 = String::from("xyz");
-        let result = longest(string1.as_str(), string2.as_str());
-        println!("The longest string is {}", result);
+        result = longest(string1.as_str(), string2.as_str());
     }
+    println!("The longest string is {}", result);
 }
 // ANCHOR_END: here