File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,17 @@ impl std::ops::Add<Duration> for Instant {
7272 type Output = Instant ;
7373
7474 fn add ( self , rhs : Duration ) -> Self :: Output {
75- self . checked_add_duration ( & rhs) . unwrap ( )
75+ self . checked_add_duration ( & rhs)
76+ . expect ( "duration addition overflow" )
7677 }
7778}
7879
7980impl std:: ops:: Sub < Duration > for Instant {
8081 type Output = Instant ;
8182
8283 fn sub ( self , rhs : Duration ) -> Self :: Output {
83- self . checked_sub_duration ( & rhs) . unwrap ( )
84+ self . checked_sub_duration ( & rhs)
85+ . expect ( "duration subtraction underflow" )
8486 }
8587}
8688
Original file line number Diff line number Diff line change @@ -272,7 +272,9 @@ impl Completion {
272272 }
273273
274274 pub ( super ) fn get_inner ( & self ) -> & Arc < CompletionInner > {
275- self . inner . as_ref ( ) . unwrap ( )
275+ self . inner
276+ . as_ref ( )
277+ . expect ( "completion inner should be initialized" )
276278 }
277279
278280 pub fn needs_link ( & self ) -> bool {
Original file line number Diff line number Diff line change @@ -59,7 +59,12 @@ impl IO for MemoryIO {
5959 } ) ,
6060 ) ;
6161 }
62- Ok ( files. get ( path) . unwrap ( ) . clone ( ) )
62+ Ok ( files
63+ . get ( path)
64+ . ok_or ( crate :: LimboError :: InternalError (
65+ "file should exist after insert" . to_string ( ) ,
66+ ) ) ?
67+ . clone ( ) )
6368 }
6469 fn remove_file ( & self , path : & str ) -> Result < ( ) > {
6570 let mut files = self . files . lock ( ) ;
You can’t perform that action at this time.
0 commit comments