File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 143
143
#![ warn(
144
144
clippy:: use_self,
145
145
clippy:: too_long_first_doc_paragraph,
146
- clippy:: redundant_pub_crate
146
+ clippy:: redundant_pub_crate,
147
+ clippy:: option_if_let_else
147
148
) ]
148
149
149
150
pub use binary_heap:: BinaryHeap ;
Original file line number Diff line number Diff line change @@ -581,10 +581,10 @@ impl<S: VecStorage<u8> + ?Sized> StringInner<S> {
581
581
/// ```
582
582
#[ inline]
583
583
pub fn remove ( & mut self , index : usize ) -> char {
584
- let ch = match self [ index..] . chars ( ) . next ( ) {
585
- Some ( ch ) => ch ,
586
- None => panic ! ( "cannot remove a char from the end of a string" ) ,
587
- } ;
584
+ let ch = self [ index..]
585
+ . chars ( )
586
+ . next ( )
587
+ . unwrap_or_else ( || panic ! ( "cannot remove a char from the end of a string" ) ) ;
588
588
589
589
let next = index + ch. len_utf8 ( ) ;
590
590
let len = self . len ( ) ;
You can’t perform that action at this time.
0 commit comments