Stream: t-compiler/help

Topic: Ownership

Boris Junk (Jul 20 2020 at 20:49, on Zulip):

Hi! Rust Book in Chapter 4.1 says "String literals ... they’re immutable". Me doing this:

let mut str1 = "other string";
println!("string inside scope: {}", str1);
str1 = "other string changed, thus mutable";
println!("string inside scope after change: {}", str1);

runs just fine :). Is the Book not updated or do i understand something wrong? BTW: Until now i'm really enjoying rust :).

Notification Bot (Jul 20 2020 at 20:52, on Zulip):

This topic was moved by simulacrum to #general > Ownership

Jake Goulding (Jul 20 2020 at 20:52, on Zulip):


Last update: Sep 28 2020 at 16:00UTC