Closed
Description
"Strings will coerece into &str with an &:
fn takes_slice(slice: &str) {
println!("Got: {}", slice);
}
fn main() {
let s = "Hello".to_string();
takes_slice(&s);
}
"
This example should have &*s
rather than &s
, and the line above it should be reworded, since this isn't a coercion. (Note coerce is misspelled as coerece)
Metadata
Metadata
Assignees
Labels
No labels