File tree Expand file tree Collapse file tree
crates/commitlog/src/stream Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,15 +92,15 @@ impl RangeFromMaybeToInclusive {
9292 } ;
9393 let end = match b. end_bound ( ) {
9494 Bound :: Unbounded => None ,
95- Bound :: Included ( end) => Some ( ( * end) . max ( start ) ) ,
96- Bound :: Excluded ( end) => Some ( end. saturating_sub ( 1 ) . max ( start ) ) ,
95+ Bound :: Included ( end) => Some ( * end) ,
96+ Bound :: Excluded ( end) => Some ( end. saturating_sub ( 1 ) ) ,
9797 } ;
9898
9999 Self { start, end }
100100 }
101101
102102 pub fn is_empty ( & self ) -> bool {
103- self . end . is_some_and ( |end| end <= self . start )
103+ self . end . is_some_and ( |end| end < self . start )
104104 }
105105
106106 pub fn contains ( & self , item : & u64 ) -> bool {
Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ mod tests {
157157 super :: retain_range ( offsets, RangeFromMaybeToInclusive :: from_range_bounds ( range) )
158158 }
159159
160+ #[ test]
161+ fn test_slice_segments_on_single_commit ( ) {
162+ let offsets = vec ! [ 0 , 10 ] ;
163+
164+ let retained = retain_range ( & offsets, 19 ..=19 ) ;
165+ assert_eq ! ( & retained, & [ 10 ] ) ;
166+ }
167+
160168 #[ test]
161169 fn test_slice_segments_on_boundary ( ) {
162170 let offsets = vec ! [ 0 , 10 , 20 , 30 ] ;
You can’t perform that action at this time.
0 commit comments