Printing a string fixed
The immediate fix for the reported error is to include the formatting string and/or to use the interpolated version.
fn main() { let name = "Foo"; println!("{}", name); println!("{name}"); }
Result:
Foo
Foo
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
The immediate fix for the reported error is to include the formatting string and/or to use the interpolated version.
fn main() { let name = "Foo"; println!("{}", name); println!("{name}"); }
Result:
Foo
Foo