Skip to content

Commit d0560c7

Browse files
committed
Fix ix
1 parent f1552a0 commit d0560c7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/range.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use {
22
crate::TextSize,
33
std::{
4-
cmp,
5-
convert::TryInto,
6-
fmt,
4+
cmp, fmt,
75
ops::{Bound, Index, IndexMut, RangeBounds},
86
},
97
};
@@ -130,8 +128,7 @@ impl TextRange {
130128
}
131129

132130
fn ix(size: TextSize) -> usize {
133-
size.try_into()
134-
.unwrap_or_else(|_| panic!("overflow when converting TextSize to usize index"))
131+
size.into()
135132
}
136133

137134
impl Index<TextRange> for str {

0 commit comments

Comments
 (0)