We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c7e55f commit 30b39f4Copy full SHA for 30b39f4
src/lib.rs
@@ -377,6 +377,9 @@ pub struct Cea608Writer {
377
impl Cea608Writer {
378
/// Push a [`Code`] into this writer
379
pub fn push(&mut self, code: Code) {
380
+ if code == Code::NUL {
381
+ return;
382
+ }
383
self.pending.push_front(code)
384
}
385
@@ -758,6 +761,16 @@ mod test {
758
761
assert_eq!(cea608.into_code(Field::ONE)[0], code);
759
762
760
763
764
+
765
+ #[test]
766
+ fn writer_ignore_padding() {
767
+ test_init_log();
768
769
+ let mut writer = Cea608Writer::default();
770
+ writer.push(Code::NUL);
771
+ writer.push(Code::LatinLowerA);
772
+ assert_eq!(writer.pop(), [0x61, 0x80]);
773
774
775
776
#[cfg(test)]
0 commit comments