Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions exercises/09_strings/strings4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ fn main() {

placeholder("rust is fun!".to_owned());

placeholder("nice weather".into());

placeholder(format!("Interpolation {}", "Station"));

// WARNING: This is byte indexing, not character indexing.
Expand Down
9 changes: 0 additions & 9 deletions solutions/09_strings/strings4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ fn main() {

string("rust is fun!".to_owned());

// Here, both answers work.
// `.into()` converts a type into an expected type.
// If it is called where `String` is expected, it will convert `&str` to `String`.
string("nice weather".into());
// But if it is called where `&str` is expected, then `&str` is kept as `&str` since no conversion is needed.
// If you remove the `#[allow(…)]` line, then Clippy will tell you to remove `.into()` below since it is a useless conversion.
#[allow(clippy::useless_conversion)]
string_slice("nice weather".into());

string(format!("Interpolation {}", "Station"));

// WARNING: This is byte indexing, not character indexing.
Expand Down
Loading