diff options
| author | Martin <mhaug@live.de> | 2021-06-12 18:19:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-12 18:19:18 +0200 |
| commit | fec1f41106862617797abf65d4eba8061cf4497b (patch) | |
| tree | 06bc5418a7fc8db6ef091a235099aba38268f2ea /src/geom | |
| parent | 4017b5a9f67e06145129d75de452c8a42e2d2f5a (diff) | |
Allow grid cells to span multiple regions. (#30)
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/length.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/geom/length.rs b/src/geom/length.rs index e9ba0853..21843d3e 100644 --- a/src/geom/length.rs +++ b/src/geom/length.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use super::*; /// An absolute length. -#[derive(Default, Copy, Clone, PartialEq, PartialOrd, Hash)] +#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct Length { @@ -85,7 +85,7 @@ impl Length { /// Set to the minimum of this and another length. pub fn set_min(&mut self, other: Self) { - *self = self.min(other); + *self = (*self).min(other); } /// The maximum of this and another length. @@ -95,7 +95,7 @@ impl Length { /// Set to the maximum of this and another length. pub fn set_max(&mut self, other: Self) { - *self = self.max(other); + *self = (*self).max(other); } /// Whether the other length fits into this one (i.e. is smaller). |
