Skip to content

Commit ae58bd6

Browse files
committed
Merge pull request #598 from jarcane/patch-1
std/str: Fix warning: deprecated item
2 parents a1abae9 + 523eff5 commit ae58bd6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/std/str/str.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(collections)]
2-
31
fn main() {
42
// (all the type annotations are superfluous)
53
// A reference to a string allocated in read only memory
@@ -33,7 +31,7 @@ fn main() {
3331
println!("Used characters: {}", trimmed_str);
3432

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

0 commit comments

Comments
 (0)