INNER CODE UNIT · Rust
fmt
autopilot-rs/autopilot-rs · src/bitmap.rs:42
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "Bitmap {{ size: {}, scale: {} }}", self.size, self.scale)
}
}
impl std::cmp::PartialEq for Bitmap {
fn eq(&self, other: &Bitmap) -> bool {
self.bitmap_eq(other, None)
}
}
impl std::hash::Hash for Bitmap {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
if let Some(rgb_image) = self.image.as_rgba8() {
rgb_image.hash(state);
}
self.size.hash(state);
(self.scale as i64).hash(state);