book/listings/ch11-writing-automated-tests/listing-11-05/src/lib.rs

14 lines
248 B
Rust

// ANCHOR: here
#[derive(Debug)]
struct Rectangle {
width: u32,
height: u32,
}
impl Rectangle {
fn can_hold(&self, other: &Rectangle) -> bool {
self.width > other.width && self.height > other.height
}
}
// ANCHOR_END: here