diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs b/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs index e6a32723f1..9732bb3bed 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs @@ -11,7 +11,7 @@ impl Rectangle { } fn can_hold(&self, other: &Rectangle) -> bool { - self.width > other.width && self.height > other.height + self.width >= other.width && self.height >= other.height } } // ANCHOR_END: here diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs b/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs index a5d3f772a8..3006040213 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs @@ -13,7 +13,7 @@ impl Rectangle { impl Rectangle { fn can_hold(&self, other: &Rectangle) -> bool { - self.width > other.width && self.height > other.height + self.width >= other.width && self.height >= other.height } } // ANCHOR_END: here