Fix a few nits with the replace idiom.
Fix a few nits with the replace idiom.

Change the match guard to be part of the pattern.

Change `"".to_string()` to a more idiomatic `String::new()` to create a new `String` without memory allocation.

rust-unofficial/patterns