rename max_size
This commit is contained in:
parent
64181e1733
commit
2bbba82448
3 changed files with 4 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1527,7 +1527,7 @@ checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "site_icons"
|
name = "site_icons"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"clap",
|
"clap",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "site_icons"
|
name = "site_icons"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
authors = ["Sam Denty <sam@samdenty.com>"]
|
authors = ["Sam Denty <sam@samdenty.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
|
|
|
@ -34,14 +34,14 @@ impl IconSize {
|
||||||
Self { width, height }
|
Self { width, height }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_size(&self) -> u32 {
|
pub fn max_rect(&self) -> u32 {
|
||||||
cmp::max(self.width, self.height)
|
cmp::max(self.width, self.height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Ord for IconSize {
|
impl Ord for IconSize {
|
||||||
fn cmp(&self, other: &Self) -> Ordering {
|
fn cmp(&self, other: &Self) -> Ordering {
|
||||||
other.max_size().cmp(&self.max_size())
|
other.max_rect().cmp(&self.max_rect())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue