I hereby claim:
- I am hosszukalman on github.
- I am kalmanhosszu (https://keybase.io/kalmanhosszu) on keybase.
- I have a public key ASBWmnbk2aBlLeHf_mKw8vymXp_I3m_K0-m6U2yua7I8hwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#[derive(Debug)] | |
struct Color { | |
red: u8, | |
green: u8, | |
blue: u8, | |
} | |
impl fmt::Display for Color { | |
// `f` is a buffer, this method must write the formatted string into it | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
write!(f, "RGB ({0}, {1}, {2}) 0X{0:02.X}{1:02.X}{2:02.X}", |
struct List(Vec<i32>); | |
impl fmt::Display for List { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
// Dereference `self` and create a reference to `vec` | |
// via destructuring. | |
let List(ref vec) = *self; | |
try!(write!(f, "[")); | |
// Iterate over `vec` in `v` while enumerating the iteration |