File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -346,9 +346,14 @@ impl MutableCommitIndexSegment {
346346 squashed
347347 }
348348
349- pub ( super ) fn save_in ( self , dir : & Path ) -> Result < Arc < ReadonlyCommitIndexSegment > , PathError > {
350- if self . num_local_commits ( ) == 0 && self . parent_file . is_some ( ) {
351- return Ok ( self . parent_file . unwrap ( ) ) ;
349+ pub ( super ) fn save_in (
350+ mut self ,
351+ dir : & Path ,
352+ ) -> Result < Arc < ReadonlyCommitIndexSegment > , PathError > {
353+ if self . num_local_commits ( ) == 0
354+ && let Some ( parent_file) = self . parent_file . take ( )
355+ {
356+ return Ok ( parent_file) ;
352357 }
353358
354359 let mut buf = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -331,9 +331,11 @@ impl MutableTable {
331331 squashed
332332 }
333333
334- fn save_in ( self , store : & TableStore ) -> TableStoreResult < Arc < ReadonlyTable > > {
335- if self . entries . is_empty ( ) && self . parent_file . is_some ( ) {
336- return Ok ( self . parent_file . unwrap ( ) ) ;
334+ fn save_in ( mut self , store : & TableStore ) -> TableStoreResult < Arc < ReadonlyTable > > {
335+ if self . entries . is_empty ( )
336+ && let Some ( parent_file) = self . parent_file . take ( )
337+ {
338+ return Ok ( parent_file) ;
337339 }
338340
339341 let buf = self . maybe_squash_with_ancestors ( ) . serialize ( ) ;
You can’t perform that action at this time.
0 commit comments