@@ -191,20 +191,21 @@ impl<N: NInt, S: EncodingSign> RleV1Encoder<N, S> {
191
191
///
192
192
/// 1. `RleV1EncoderState::Empty`:
193
193
/// - Transitions to the `Literal` state with the given value as the first element in the buffer.
194
- /// 2. `RleV1EncoderState::Literal`:
195
- /// - The value is added to the buffer. If the buffer length reaches `MAX_LITERAL_LENGTH`, the buffer is written out
196
- /// and the state transitions to `Empty`.
197
- /// - If the buffer length is at least `MIN_RUN_LENGTH` and the values in the buffer form a valid run (i.e., the deltas
198
- /// between consecutive values are consistent and within the allowed range), the state transitions to `Run`.
199
- /// - Otherwise, the state remains `Literal`.
200
- /// 3. `RleV1EncoderState::Run`:
194
+ ///
195
+ /// 2. `RleV1EncoderState::Run`:
201
196
/// - If the value continues the current run (i.e., it matches the expected value based on the run's delta and length),
202
197
/// the run length is incremented. If the run length reaches `MAX_RUN_LENGTH`, the run is written out and the state
203
198
/// transitions to `Empty`.
204
199
/// - If the value does not continue the current run, the existing run is written out and the state transitions to
205
200
/// `Literal` with the new value as the first element in the buffer.
206
201
///
207
-
202
+ /// 3. `RleV1EncoderState::Literal`:
203
+ /// - The value is added to the buffer. If the buffer length reaches `MAX_LITERAL_LENGTH`, the buffer is written out
204
+ /// and the state transitions to `Empty`.
205
+ /// - If the buffer length is at least `MIN_RUN_LENGTH` and the values in the buffer form a valid run (i.e., the deltas
206
+ /// between consecutive values are consistent and within the allowed range), the state transitions to `Run`.
207
+ /// - Otherwise, the state remains `Literal`.
208
+ ///
208
209
fn process_value ( & mut self , value : N ) {
209
210
match & mut self . state {
210
211
RleV1EncodingState :: Empty => {
@@ -271,12 +272,12 @@ impl<N: NInt, S: EncodingSign> RleV1Encoder<N, S> {
271
272
/// 1. `RleV1EncoderState::Empty`:
272
273
/// - No action is needed as there are no buffered values to write.
273
274
///
274
- /// 2. `RleV1EncoderState::Run`:
275
- /// - Writes out the current run of values.
276
- ///
277
275
/// 3. `RleV1EncoderState::Literal`:
278
276
/// - Writes out the buffered literal values.
279
277
///
278
+ /// 2. `RleV1EncoderState::Run`:
279
+ /// - Writes out the current run of values.
280
+ ///
280
281
/// After calling this function, the encoder state will be reset to `Empty`.
281
282
fn flush ( & mut self ) {
282
283
let state = std:: mem:: take ( & mut self . state ) ;
0 commit comments