We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8186f0d + 4504870 commit abbccacCopy full SHA for abbccac
src/hello/print.md
@@ -54,6 +54,13 @@ fn main() {
54
// handling. This will not work.
55
println!("This struct `{}` won't print...", Structure(3));
56
// FIXME ^ Comment out this line.
57
+
58
+ // For Rust 1.58 and above, you can directly capture the argument from
59
+ // surrounding variable. Just like the above, this will output
60
+ // " 1". 5 white spaces and a "1".
61
+ let number: f64 = 1.0;
62
+ let width: usize = 6;
63
+ println!("{number:>width$}");
64
}
65
```
66
0 commit comments