Files
2020-03-29 00:03:11 +08:00

16 lines
237 B
Rust

use std::fmt;
struct X {
i: i32,
}
impl fmt::Display for X {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Hello: {}", self.i)
}
}
fn main() {
let x = X { i: 111, };
println!("{}", x);
}