Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions examples/std/str/str.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(collections)]

fn main() {
// (all the type annotations are superfluous)
// A reference to a string allocated in read only memory
Expand Down Expand Up @@ -33,7 +31,7 @@ fn main() {
println!("Used characters: {}", trimmed_str);

// Heap allocate a string
let alice = String::from_str("I like dogs");
let alice = String::from("I like dogs");
// Allocate new memory and store the modified string there
let bob: String = alice.replace("dog", "cat");

Expand Down