Skip to content

Commit a74141f

Browse files
author
Andrea Calabrese
committed
Fix errors for merge request
Signed-off-by: Andrea Calabrese <andrea.calabrese@amarulasolutions.com>
1 parent c7cf018 commit a74141f

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

src/uucore/src/lib/features/encoding.rs

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -552,36 +552,12 @@ impl SupportsFastDecodeAndEncode for Base32Wrapper {
552552
self.inner.valid_decoding_multiple()
553553
}
554554

555-
fn pad_remainder(&self, remainder: &[u8]) -> Option<PadResult> {
556-
if remainder.is_empty() || remainder.contains(&b'=') {
557-
return None;
558-
}
559-
560-
const VALID_REMAINDERS: [usize; 4] = [2, 4, 5, 7];
561-
562-
let mut len = remainder.len();
563-
let mut trimmed = false;
564-
565-
while len > 0 && !VALID_REMAINDERS.contains(&len) {
566-
len -= 1;
567-
trimmed = true;
568-
}
569-
570-
if len == 0 {
571-
return None;
572-
}
573-
574-
let mut padded = remainder[..len].to_vec();
575-
let missing = self.valid_decoding_multiple() - padded.len();
576-
padded.extend(std::iter::repeat_n(b'=', missing));
577-
578-
Some(PadResult {
579-
chunk: padded,
580-
had_invalid_tail: trimmed,
581-
})
555+
fn should_buffer_decoding(&self) -> bool {
556+
true
582557
}
583558

584-
fn supports_partial_decode(&self) -> bool {
559+
fn should_buffer_encoding(&self) -> bool {
585560
true
586561
}
562+
587563
}

0 commit comments

Comments
 (0)