Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/text-size/src/range.rs')
| -rw-r--r-- | lib/text-size/src/range.rs | 7 |
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 { |