aboutsummaryrefslogtreecommitdiff
path: root/src/selection.rs
diff options
context:
space:
mode:
authorJoe Wilm <jwilm@users.noreply.github.com>2017-01-06 21:51:24 -0800
committerGitHub <noreply@github.com>2017-01-06 21:51:24 -0800
commit852c2d8f15bfc11f0222fa08626c38724accd35a (patch)
tree0880b8e38d76ae4ba0fb1772fbd11cae53168729 /src/selection.rs
parent62739bd226974358a811b4680b4b74c268418f5b (diff)
parent4e1f4c8cd7180606156b71ad0222f60e4559f2b3 (diff)
downloadr-alacritty-852c2d8f15bfc11f0222fa08626c38724accd35a.tar.gz
r-alacritty-852c2d8f15bfc11f0222fa08626c38724accd35a.tar.bz2
r-alacritty-852c2d8f15bfc11f0222fa08626c38724accd35a.zip
Merge pull request #131 from Manishearth/stable
Make it compile on stable Rust (almost)
Diffstat (limited to 'src/selection.rs')
-rw-r--r--src/selection.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/selection.rs b/src/selection.rs
index ebc84bee..3e5b799c 100644
--- a/src/selection.rs
+++ b/src/selection.rs
@@ -19,9 +19,8 @@
//! when text is added/removed/scrolled on the screen. The selection should
//! also be cleared if the user clicks off of the selection.
use std::mem;
-use std::ops::RangeInclusive;
-use index::{Point, Column, Side, Linear, Line};
+use index::{Point, Column, RangeInclusive, Side, Linear, Line};
use grid::ToRange;
/// The area selected
@@ -107,14 +106,14 @@ impl Selection {
// Single-cell selections are a special case
if start == end {
- if start_side != end_side {
+ if start_side == end_side {
+ return None;
+ } else {
return Some(Span {
ty: SpanType::Inclusive,
front: *front,
tail: *tail
});
- } else {
- return None;
}
}
@@ -248,7 +247,7 @@ impl ToRange for Span {
SpanType::ExcludeTail => (start, Span::exclude_end(end))
};
- start...end
+ RangeInclusive::new(start, end)
}
}