From 9a62f4729215a7ca4a69cf54df8663ff84c27ec2 Mon Sep 17 00:00:00 2001 From: Nathan Lilienthal Date: Thu, 24 Sep 2020 19:40:57 -0400 Subject: Remove unused Linear newtype. (#4248) --- alacritty_terminal/src/index.rs | 23 ----------------------- 1 file changed, 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) -> 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 { -- cgit v1.2.3-54-g00ecf