diff options
author | Nathan Lilienthal <nathan@nixpulvis.com> | 2020-09-24 19:40:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 19:40:57 -0400 |
commit | 9a62f4729215a7ca4a69cf54df8663ff84c27ec2 (patch) | |
tree | 1118b056db598968fd3c550b089a9898e94875b2 /alacritty_terminal/src | |
parent | 62c300c14ce7a96373e0094763e9fd035b6b9b6d (diff) | |
download | alacritty-9a62f4729215a7ca4a69cf54df8663ff84c27ec2.tar.gz alacritty-9a62f4729215a7ca4a69cf54df8663ff84c27ec2.zip |
Remove unused Linear newtype. (#4248)
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r-- | alacritty_terminal/src/index.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/alacritty_terminal/src/index.rs b/alacritty_terminal/src/index.rs index baed323e..2c28bec2 100644 --- a/alacritty_terminal/src/index.rs +++ b/alacritty_terminal/src/index.rs @@ -220,28 +220,6 @@ impl fmt::Display for Column { } } -/// A linear index. -/// -/// Newtype to avoid passing values incorrectly. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd, Serialize, Deserialize)] -pub struct Linear(pub usize); - -impl Linear { - pub fn new(columns: Column, column: Column, line: Line) -> Self { - Linear(line.0 * columns.0 + column.0) - } - - pub fn from_point(columns: Column, point: Point<usize>) -> Self { - Linear(point.line * columns.0 + point.col.0) - } -} - -impl fmt::Display for Linear { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "Linear({})", self.0) - } -} - // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. @@ -485,7 +463,6 @@ macro_rules! ops { ops!(Line, Line); ops!(Column, Column); -ops!(Linear, Linear); #[cfg(test)] mod tests { |