diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-19 21:23:03 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-19 21:23:03 +0100 |
| commit | 898dc38ec153709929d2513fb9d040dd2c1ce0fe (patch) | |
| tree | 11742165476f2c2595df91841808de3567b7c876 /src/geom/spec.rs | |
| parent | 264a7dedd42e27cd9e604037640cf0594b2ec46b (diff) | |
Better debug representations 💻
Diffstat (limited to 'src/geom/spec.rs')
| -rw-r--r-- | src/geom/spec.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/geom/spec.rs b/src/geom/spec.rs index c61f9526..510bac84 100644 --- a/src/geom/spec.rs +++ b/src/geom/spec.rs @@ -1,7 +1,7 @@ use super::*; /// A container with a horizontal and vertical component. -#[derive(Debug, Default, Copy, Clone, Eq, PartialEq)] +#[derive(Default, Copy, Clone, Eq, PartialEq)] pub struct Spec<T> { /// The horizontal component. pub horizontal: T, @@ -74,6 +74,12 @@ impl<T> Switch for Spec<T> { } } +impl<T: Debug> Debug for Spec<T> { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "Spec({:?}, {:?})", self.horizontal, self.vertical) + } +} + /// The two specific layouting axes. #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum SpecAxis { |
