Browse Source

add types to string bindings

Lucas Stadler 10 years ago
parent
commit
03034d9c45
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rust/book/src/main.rs

+ 2 - 2
rust/book/src/main.rs

@ -94,8 +94,8 @@ fn main() {
94 94
    }
95 95
96 96
    // strings
97
    let string_slice = "Hello, World!";
98
    let mut string = string_slice.to_string();
97
    let string_slice: &str = "Hello, World!";
98
    let mut string: String = string_slice.to_string();
99 99
    println!("{} = {}", string_slice, string);
100 100
101 101
    string.push_str(" (again...)");