You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-22 16:57:41 +02:00
Inline variables printed with println!
and friends (#315)
The course follows the style of inlining variable names where possible in `println!` statements.
This commit is contained in:
@ -6,7 +6,7 @@ We've seen how a function can take arguments which implement a trait:
|
||||
use std::fmt::Display;
|
||||
|
||||
fn print<T: Display>(x: T) {
|
||||
println!("Your value: {}", x);
|
||||
println!("Your value: {x}");
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Reference in New Issue
Block a user