Skip to content

Commit 4b56eec

Browse files
authored
Simplify offset method error handling
1 parent 51de3cf commit 4b56eec

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

libcc2rs/src/rc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ impl<T> Ptr<T> {
297297

298298
#[inline]
299299
pub fn offset(&self, offset: impl TryInto<isize>) -> Self {
300-
let offset = match offset.try_into() {
301-
Ok(o) => o,
302-
Err(_) => panic!("the offset must fit in a isize"),
303-
};
300+
let offset = offset.try_into().expect("the offset must fit in a isize");
304301
let step = self.elem_step();
305302
Self {
306303
kind: self.kind.clone(),

0 commit comments

Comments
 (0)