Fixed version of print
This commit is contained in:
parent
459bfb7caa
commit
bef89a0bee
1
rustbyexample/.gitignore
vendored
1
rustbyexample/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/hello/hello
|
/hello/hello
|
||||||
|
/hello/print
|
||||||
|
@ -14,10 +14,14 @@ fn main() {
|
|||||||
|
|
||||||
println!("{number:>0width$}", number=1, width=6);
|
println!("{number:>0width$}", number=1, width=6);
|
||||||
|
|
||||||
println!("My name is {0}, {1} {0}", "Bond");
|
println!("My name is {0}, {1} {0}", "Bond", "James");
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[derive(Debug)]
|
||||||
struct Structure(i32);
|
struct Structure(i32);
|
||||||
|
|
||||||
println!("This struct `{}` won't print...", Structure(3));
|
println!("This struct `{:?}` will print...", Structure(3));
|
||||||
|
|
||||||
|
let pi = 3.141592;
|
||||||
|
println!("Pi is roughly {:.3}", pi);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user