Merge an assert + cast into a try_into
call
This commit is contained in:
parent
0195812aea
commit
6fc8779b1e
@ -35,8 +35,7 @@ pub fn prefix_slice_suffix<'pat>(&mut self,
|
||||
opt_slice: Option<&'pat Pattern<'tcx>>,
|
||||
suffix: &'pat [Pattern<'tcx>]) {
|
||||
let min_length = prefix.len() + suffix.len();
|
||||
assert!(min_length < u32::MAX as usize);
|
||||
let min_length = min_length as u32;
|
||||
let min_length = min_length.try_into().unwrap();
|
||||
|
||||
match_pairs.extend(
|
||||
prefix.iter()
|
||||
|
Loading…
Reference in New Issue
Block a user