Much renaming and refreshing of RBE
This commit is contained in:
14
rustbyexample/hello.d/print.d/print_display.rs
Normal file
14
rustbyexample/hello.d/print.d/print_display.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use std::fmt;
|
||||
|
||||
struct Structure(i32);
|
||||
|
||||
impl fmt::Display for Structure {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let s = Structure(4);
|
||||
println!("s={}", s);
|
||||
}
|
Reference in New Issue
Block a user