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 143143#![ warn(
144144 clippy:: use_self,
145145 clippy:: too_long_first_doc_paragraph,
146- clippy:: redundant_pub_crate
146+ clippy:: redundant_pub_crate,
147+ clippy:: option_if_let_else
147148) ]
148149
149150pub 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> {
581581 /// ```
582582 #[ inline]
583583 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" ) ) ;
588588
589589 let next = index + ch. len_utf8 ( ) ;
590590 let len = self . len ( ) ;
You can’t perform that action at this time.
0 commit comments