mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-24 10:48:14 +08:00
12 lines
212 B
Rust
12 lines
212 B
Rust
#[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
|
|
}
|
|
}
|