2016-07-04 00:05:28 -04:00
|
|
|
// Copyright 2016 Joe Wilm, The Alacritty Project Contributors
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
//! Line and Column newtypes for strongly typed tty/grid/terminal APIs
|
|
|
|
|
|
|
|
/// Indexing types and implementations for Grid and Line
|
2016-12-22 13:43:06 -05:00
|
|
|
use std::cmp::{Ord, Ordering};
|
2016-07-04 00:05:28 -04:00
|
|
|
use std::fmt;
|
2017-01-06 19:26:31 -05:00
|
|
|
use std::ops::{self, Deref, Add, Range};
|
2016-07-04 00:05:28 -04:00
|
|
|
|
2016-12-22 13:43:06 -05:00
|
|
|
/// The side of a cell
|
|
|
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
|
|
|
pub enum Side {
|
|
|
|
Left,
|
|
|
|
Right
|
|
|
|
}
|
|
|
|
|
2016-07-04 00:05:28 -04:00
|
|
|
/// Index in the grid using row, column notation
|
2016-12-22 13:43:06 -05:00
|
|
|
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Serialize, Deserialize, PartialOrd)]
|
2018-03-06 23:57:40 -05:00
|
|
|
pub struct Point<L=Line> {
|
|
|
|
pub line: L,
|
2016-12-22 13:43:06 -05:00
|
|
|
pub col: Column,
|
|
|
|
}
|
|
|
|
|
2018-03-06 23:57:40 -05:00
|
|
|
impl<L> Point<L> {
|
|
|
|
pub fn new(line: L, col: Column) -> Point<L> {
|
2018-03-04 17:40:15 -05:00
|
|
|
Point { line, col }
|
2016-12-22 13:43:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-29 11:09:29 -05:00
|
|
|
impl Ord for Point {
|
|
|
|
fn cmp(&self, other: &Point) -> Ordering {
|
2016-12-22 13:43:06 -05:00
|
|
|
use std::cmp::Ordering::*;
|
|
|
|
match (self.line.cmp(&other.line), self.col.cmp(&other.col)) {
|
|
|
|
(Equal, Equal) => Equal,
|
2017-01-06 23:44:51 -05:00
|
|
|
(Equal, ord) |
|
2016-12-22 13:43:06 -05:00
|
|
|
(ord, Equal) => ord,
|
|
|
|
(Less, _) => Less,
|
|
|
|
(Greater, _) => Greater,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-20 18:30:59 -04:00
|
|
|
impl From<Point<usize>> for Point<isize> {
|
|
|
|
fn from(point: Point<usize>) -> Self {
|
|
|
|
Point::new(point.line as isize, point.col)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<Point<isize>> for Point<usize> {
|
|
|
|
fn from(point: Point<isize>) -> Self {
|
|
|
|
Point::new(point.line as usize, point.col)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-22 15:39:26 -04:00
|
|
|
impl From<Point> for Point<usize> {
|
|
|
|
fn from(point: Point) -> Self {
|
|
|
|
Point::new(point.line.0, point.col)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-04 00:05:28 -04:00
|
|
|
/// A line
|
|
|
|
///
|
|
|
|
/// Newtype to avoid passing values incorrectly
|
2016-11-19 19:16:20 -05:00
|
|
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd, Serialize, Deserialize)]
|
2016-07-04 00:05:28 -04:00
|
|
|
pub struct Line(pub usize);
|
|
|
|
|
|
|
|
impl fmt::Display for Line {
|
2018-12-10 12:53:56 -05:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2017-01-01 21:28:49 -05:00
|
|
|
write!(f, "{}", self.0)
|
2016-07-04 00:05:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A column
|
|
|
|
///
|
|
|
|
/// Newtype to avoid passing values incorrectly
|
2016-11-19 19:16:20 -05:00
|
|
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Ord, PartialOrd, Serialize, Deserialize)]
|
2016-07-04 00:05:28 -04:00
|
|
|
pub struct Column(pub usize);
|
|
|
|
|
|
|
|
impl fmt::Display for Column {
|
2018-12-10 12:53:56 -05:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2017-01-01 21:28:49 -05:00
|
|
|
write!(f, "{}", self.0)
|
2016-07-04 00:05:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-22 13:43:06 -05:00
|
|
|
/// 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 fmt::Display for Linear {
|
2018-12-10 12:53:56 -05:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2016-12-22 13:43:06 -05:00
|
|
|
write!(f, "Linear({})", self.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-05 20:42:55 -05:00
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
//
|
|
|
|
// implements binary operators "&T op U", "T op &U", "&T op &U"
|
|
|
|
// based on "T op U" where T and U are expected to be `Copy`able
|
2016-07-04 00:05:28 -04:00
|
|
|
macro_rules! forward_ref_binop {
|
|
|
|
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
|
|
|
|
impl<'a> $imp<$u> for &'a $t {
|
|
|
|
type Output = <$t as $imp<$u>>::Output;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn $method(self, other: $u) -> <$t as $imp<$u>>::Output {
|
|
|
|
$imp::$method(*self, other)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> $imp<&'a $u> for $t {
|
|
|
|
type Output = <$t as $imp<$u>>::Output;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
|
|
|
|
$imp::$method(self, *other)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, 'b> $imp<&'a $u> for &'b $t {
|
|
|
|
type Output = <$t as $imp<$u>>::Output;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
|
|
|
|
$imp::$method(*self, *other)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Macro for deriving deref
|
|
|
|
macro_rules! deref {
|
|
|
|
($ty:ty, $target:ty) => {
|
|
|
|
impl Deref for $ty {
|
|
|
|
type Target = $target;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn deref(&self) -> &$target {
|
|
|
|
&self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! add {
|
|
|
|
($ty:ty, $construct:expr) => {
|
|
|
|
impl ops::Add<$ty> for $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn add(self, rhs: $ty) -> $ty {
|
|
|
|
$construct(self.0 + rhs.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! sub {
|
|
|
|
($ty:ty, $construct:expr) => {
|
|
|
|
impl ops::Sub<$ty> for $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn sub(self, rhs: $ty) -> $ty {
|
|
|
|
$construct(self.0 - rhs.0)
|
|
|
|
}
|
|
|
|
}
|
2016-08-22 11:37:50 -04:00
|
|
|
|
|
|
|
impl<'a> ops::Sub<$ty> for &'a $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn sub(self, rhs: $ty) -> $ty {
|
|
|
|
$construct(self.0 - rhs.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> ops::Sub<&'a $ty> for $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn sub(self, rhs: &'a $ty) -> $ty {
|
|
|
|
$construct(self.0 - rhs.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, 'b> ops::Sub<&'a $ty> for &'b $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn sub(self, rhs: &'a $ty) -> $ty {
|
|
|
|
$construct(self.0 - rhs.0)
|
|
|
|
}
|
|
|
|
}
|
2016-07-04 00:05:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-06 18:25:04 -05:00
|
|
|
/// This exists because we can't implement Iterator on Range
|
|
|
|
/// and the existing impl needs the unstable Step trait
|
|
|
|
/// This should be removed and replaced with a Step impl
|
|
|
|
/// in the ops macro when `step_by` is stabilized
|
|
|
|
pub struct IndexRange<T>(pub Range<T>);
|
|
|
|
|
|
|
|
impl<T> From<Range<T>> for IndexRange<T> {
|
|
|
|
fn from(from: Range<T>) -> Self {
|
|
|
|
IndexRange(from)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-06 19:26:31 -05:00
|
|
|
pub enum RangeInclusive<Idx> {
|
|
|
|
Empty {
|
|
|
|
at: Idx,
|
|
|
|
},
|
|
|
|
NonEmpty {
|
|
|
|
start: Idx,
|
|
|
|
end: Idx,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<Idx> RangeInclusive<Idx> {
|
|
|
|
pub fn new(from: Idx, to: Idx) -> Self {
|
|
|
|
RangeInclusive::NonEmpty {
|
|
|
|
start: from,
|
|
|
|
end: to
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! inclusive {
|
|
|
|
($ty:ty, $steps_add_one:expr) => {
|
|
|
|
// impl copied from stdlib, can be removed when inclusive_range is stabilized
|
|
|
|
impl Iterator for RangeInclusive<$ty> {
|
|
|
|
type Item = $ty;
|
2017-01-06 18:48:23 -05:00
|
|
|
|
2017-01-06 19:26:31 -05:00
|
|
|
#[inline]
|
|
|
|
fn next(&mut self) -> Option<$ty> {
|
2018-12-10 12:53:56 -05:00
|
|
|
use crate::index::RangeInclusive::*;
|
2017-01-06 19:26:31 -05:00
|
|
|
|
|
|
|
match *self {
|
2018-12-10 12:53:56 -05:00
|
|
|
Empty { .. } => None, // empty iterators yield no values
|
2017-01-06 19:26:31 -05:00
|
|
|
|
|
|
|
NonEmpty { ref mut start, ref mut end } => {
|
|
|
|
|
|
|
|
// march start towards (maybe past!) end and yield the old value
|
|
|
|
if start <= end {
|
|
|
|
let old = *start;
|
|
|
|
*start = old + 1;
|
2018-12-10 12:53:56 -05:00
|
|
|
Some(old)
|
|
|
|
} else {
|
|
|
|
*self = Empty { at: *end };
|
|
|
|
None
|
2017-01-06 19:26:31 -05:00
|
|
|
}
|
|
|
|
}
|
2018-12-10 12:53:56 -05:00
|
|
|
}
|
2017-01-06 19:26:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
2018-12-10 12:53:56 -05:00
|
|
|
use crate::index::RangeInclusive::*;
|
2017-01-06 19:26:31 -05:00
|
|
|
|
|
|
|
match *self {
|
|
|
|
Empty { .. } => (0, Some(0)),
|
|
|
|
|
2018-07-21 13:17:41 -04:00
|
|
|
NonEmpty { start, end } => {
|
2017-01-06 19:26:31 -05:00
|
|
|
let added = $steps_add_one(start, end);
|
|
|
|
match added {
|
|
|
|
Some(hint) => (hint.saturating_add(1), hint.checked_add(1)),
|
|
|
|
None => (0, None)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-21 13:17:41 -04:00
|
|
|
fn steps_add_one_u8(start: u8, end: u8) -> Option<usize> {
|
|
|
|
if start < end {
|
|
|
|
Some((end - start) as usize)
|
2017-01-06 19:26:31 -05:00
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inclusive!(u8, steps_add_one_u8);
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_range() {
|
|
|
|
assert_eq!(RangeInclusive::new(1,10).collect::<Vec<_>>(),
|
|
|
|
vec![1,2,3,4,5,6,7,8,9,10]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// can be removed if range_contains is stabilized
|
2017-01-06 18:48:23 -05:00
|
|
|
pub trait Contains {
|
|
|
|
type Content;
|
|
|
|
fn contains_(&self, item: Self::Content) -> bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: PartialOrd<T>> Contains for Range<T> {
|
|
|
|
type Content = T;
|
|
|
|
fn contains_(&self, item: Self::Content) -> bool {
|
|
|
|
(self.start <= item) && (item < self.end)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: PartialOrd<T>> Contains for RangeInclusive<T> {
|
|
|
|
type Content = T;
|
|
|
|
fn contains_(&self, item: Self::Content) -> bool {
|
2017-01-06 23:44:51 -05:00
|
|
|
if let RangeInclusive::NonEmpty{ref start, ref end} = *self {
|
2017-01-06 18:48:23 -05:00
|
|
|
(*start <= item) && (item <= *end)
|
|
|
|
} else { false }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-04 00:05:28 -04:00
|
|
|
macro_rules! ops {
|
|
|
|
($ty:ty, $construct:expr) => {
|
|
|
|
add!($ty, $construct);
|
|
|
|
sub!($ty, $construct);
|
|
|
|
deref!($ty, usize);
|
|
|
|
forward_ref_binop!(impl Add, add for $ty, $ty);
|
|
|
|
|
2017-01-06 18:25:04 -05:00
|
|
|
impl $ty {
|
2016-07-04 00:05:28 -04:00
|
|
|
#[inline]
|
2018-07-21 13:17:41 -04:00
|
|
|
fn steps_between(start: $ty, end: $ty, by: $ty) -> Option<usize> {
|
|
|
|
if by == $construct(0) { return None; }
|
|
|
|
if start < end {
|
2016-07-04 00:05:28 -04:00
|
|
|
// Note: We assume $t <= usize here
|
2018-07-21 13:17:41 -04:00
|
|
|
let diff = (end - start).0;
|
2016-07-04 00:05:28 -04:00
|
|
|
let by = by.0;
|
|
|
|
if diff % by > 0 {
|
|
|
|
Some(diff / by + 1)
|
|
|
|
} else {
|
|
|
|
Some(diff / by)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Some(0)
|
|
|
|
}
|
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
|
|
|
|
#[inline]
|
2018-07-21 13:17:41 -04:00
|
|
|
fn steps_between_by_one(start: $ty, end: $ty) -> Option<usize> {
|
|
|
|
Self::steps_between(start, end, $construct(1))
|
2016-07-15 10:55:44 -04:00
|
|
|
}
|
2017-01-06 18:25:04 -05:00
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
|
2017-01-06 18:25:04 -05:00
|
|
|
impl Iterator for IndexRange<$ty> {
|
|
|
|
type Item = $ty;
|
2016-07-15 10:55:44 -04:00
|
|
|
#[inline]
|
2017-01-06 18:25:04 -05:00
|
|
|
fn next(&mut self) -> Option<$ty> {
|
|
|
|
if self.0.start < self.0.end {
|
|
|
|
let old = self.0.start;
|
|
|
|
self.0.start = old + 1;
|
|
|
|
Some(old)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
}
|
|
|
|
#[inline]
|
2017-01-06 18:25:04 -05:00
|
|
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
2018-07-21 13:17:41 -04:00
|
|
|
match Self::Item::steps_between_by_one(self.0.start, self.0.end) {
|
2017-01-06 18:25:04 -05:00
|
|
|
Some(hint) => (hint, Some(hint)),
|
|
|
|
None => (0, None)
|
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
}
|
2017-01-06 18:25:04 -05:00
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
|
2017-01-06 19:26:31 -05:00
|
|
|
inclusive!($ty, <$ty>::steps_between_by_one);
|
|
|
|
|
2017-01-06 18:25:04 -05:00
|
|
|
impl DoubleEndedIterator for IndexRange<$ty> {
|
2016-07-15 10:55:44 -04:00
|
|
|
#[inline]
|
2017-01-06 18:25:04 -05:00
|
|
|
fn next_back(&mut self) -> Option<$ty> {
|
|
|
|
if self.0.start < self.0.end {
|
|
|
|
let new = self.0.end - 1;
|
|
|
|
self.0.end = new;
|
|
|
|
Some(new)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
2016-07-15 10:55:44 -04:00
|
|
|
}
|
2016-07-04 00:05:28 -04:00
|
|
|
}
|
|
|
|
impl ops::AddAssign<$ty> for $ty {
|
|
|
|
#[inline]
|
|
|
|
fn add_assign(&mut self, rhs: $ty) {
|
|
|
|
self.0 += rhs.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ops::SubAssign<$ty> for $ty {
|
|
|
|
#[inline]
|
|
|
|
fn sub_assign(&mut self, rhs: $ty) {
|
|
|
|
self.0 -= rhs.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ops::AddAssign<usize> for $ty {
|
|
|
|
#[inline]
|
|
|
|
fn add_assign(&mut self, rhs: usize) {
|
|
|
|
self.0 += rhs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ops::SubAssign<usize> for $ty {
|
|
|
|
#[inline]
|
|
|
|
fn sub_assign(&mut self, rhs: usize) {
|
|
|
|
self.0 -= rhs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<usize> for $ty {
|
|
|
|
#[inline]
|
|
|
|
fn from(val: usize) -> $ty {
|
|
|
|
$construct(val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ops::Add<usize> for $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn add(self, rhs: usize) -> $ty {
|
|
|
|
$construct(self.0 + rhs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ops::Sub<usize> for $ty {
|
|
|
|
type Output = $ty;
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn sub(self, rhs: usize) -> $ty {
|
|
|
|
$construct(self.0 - rhs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ops!(Line, Line);
|
|
|
|
ops!(Column, Column);
|
2016-12-22 13:43:06 -05:00
|
|
|
ops!(Linear, Linear);
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2016-12-29 11:09:29 -05:00
|
|
|
use super::{Line, Column, Point};
|
2016-12-22 13:43:06 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn location_ordering() {
|
2016-12-29 11:09:29 -05:00
|
|
|
assert!(Point::new(Line(0), Column(0)) == Point::new(Line(0), Column(0)));
|
|
|
|
assert!(Point::new(Line(1), Column(0)) > Point::new(Line(0), Column(0)));
|
|
|
|
assert!(Point::new(Line(0), Column(1)) > Point::new(Line(0), Column(0)));
|
|
|
|
assert!(Point::new(Line(1), Column(1)) > Point::new(Line(0), Column(0)));
|
|
|
|
assert!(Point::new(Line(1), Column(1)) > Point::new(Line(0), Column(1)));
|
|
|
|
assert!(Point::new(Line(1), Column(1)) > Point::new(Line(1), Column(0)));
|
2016-12-22 13:43:06 -05:00
|
|
|
}
|
|
|
|
}
|