Unnamed repository; edit this file 'description' to name the repository.
Fix ix
Aleksey Kladov 2020-03-12
parent e27818e · commit c44a24e
-rw-r--r--lib/text-size/src/range.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/text-size/src/range.rs b/lib/text-size/src/range.rs
index e70a7b6a33..c06c19dfe4 100644
--- a/lib/text-size/src/range.rs
+++ b/lib/text-size/src/range.rs
@@ -1,9 +1,7 @@
use {
crate::TextSize,
std::{
- cmp,
- convert::TryInto,
- fmt,
+ cmp, fmt,
ops::{Bound, Index, IndexMut, RangeBounds},
},
};
@@ -130,8 +128,7 @@ impl TextRange {
}
fn ix(size: TextSize) -> usize {
- size.try_into()
- .unwrap_or_else(|_| panic!("overflow when converting TextSize to usize index"))
+ size.into()
}
impl Index<TextRange> for str {