Activity for 1.2.3
This commit is contained in:
parent
cb36ed01b2
commit
0d0edf5629
@ -23,6 +23,13 @@ struct Color {
|
||||
blue: u8,
|
||||
}
|
||||
|
||||
impl Display for Color {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
write!(f, "RGB ({}, {}, {}) 0x{:02X}{:02X}{:02X}", self.red, self.green, self.blue, self.red, self.green, self.blue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
for city in [
|
||||
City { name: "Dublin", lat: 53.347778, lon: -6.259722 },
|
||||
@ -38,5 +45,6 @@ fn main() {
|
||||
Color { red: 0, green: 0, blue: 0 },
|
||||
].iter() {
|
||||
println!("{:?}", *color);
|
||||
println!("{}", *color);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user