Change "".to_string() to String::new()

I mistakenly lost this change in my previous pull request, sorry!
pull/40/head
diwic 8 years ago committed by GitHub
parent 9d955043a4
commit 5f484ad473

@ -29,7 +29,7 @@ fn a_to_b(e: &mut MyEnum) {
// (note that empty strings don't allocate).
// Then, construct the new enum variant (which will
// be assigned to `*e`, because it is the result of the `if let` expression).
MyEnum::B { name: mem::replace(name, "".to_string()) }
MyEnum::B { name: mem::replace(name, String::new()) }
// In all other cases, we return immediately, thus skipping the assignment
} else { return }

Loading…
Cancel
Save