diff options
Diffstat (limited to 'alacritty_terminal/src/index.rs')
-rw-r--r-- | alacritty_terminal/src/index.rs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/alacritty_terminal/src/index.rs b/alacritty_terminal/src/index.rs index 9464b8d8..dd7faa7b 100644 --- a/alacritty_terminal/src/index.rs +++ b/alacritty_terminal/src/index.rs @@ -5,10 +5,9 @@ use std::cmp::{max, min, Ord, Ordering}; use std::fmt; use std::ops::{Add, AddAssign, Deref, Sub, SubAssign}; +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use alacritty_config_derive::SerdeReplace; - use crate::grid::Dimensions; /// The side of a cell. @@ -46,7 +45,8 @@ pub enum Boundary { } /// Index in the grid using row, column notation. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, Default, Eq, PartialEq)] +#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Point<L = Line, C = Column> { pub line: L, pub column: C, @@ -131,7 +131,8 @@ impl<L: Ord, C: Ord> Ord for Point<L, C> { /// A line. /// /// Newtype to avoid passing values incorrectly. -#[derive(Serialize, Deserialize, Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Line(pub i32); impl Line { @@ -224,19 +225,8 @@ impl PartialEq<usize> for Line { /// A column. /// /// Newtype to avoid passing values incorrectly. -#[derive( - SerdeReplace, - Serialize, - Deserialize, - Debug, - Copy, - Clone, - Eq, - PartialEq, - Default, - Ord, - PartialOrd, -)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Column(pub usize); impl fmt::Display for Column { |