Description: use older branch of crate nom
 This essentially reverts upstream git commit 811b3dd.
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-08-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,7 +34,7 @@
 image = { version = "0.25", default-features = false, features = ["png"] }
 iter_fixed = "0.4"
 log = "0.4"
-nom = "8.0"
+nom = "7.1"
 profiling = "1.0"
 regex = "1.11"
 thiserror = "2.0"
--- a/src/vobsub/img.rs
+++ b/src/vobsub/img.rs
@@ -8,8 +8,8 @@
     bits::complete::{tag as tag_bits, take as take_bits},
     branch::alt,
     combinator::value,
-    sequence::preceded,
-    IResult, Parser,
+    sequence::{preceded, Tuple},
+    IResult,
 };
 use thiserror::Error;
 
@@ -136,7 +136,7 @@
     let count2 = preceded(tag_bits(0, 2u8), take_bits(4u16));
     // Count for 1-nibble RLE.
     let count1 = take_bits(2u16);
-    alt((end_of_line, count4, count3, count2, count1)).parse(input)
+    alt((end_of_line, count4, count3, count2, count1))(input)
 }
 
 /// Parse an `Rle`.
--- a/src/vobsub/mpeg2/clock.rs
+++ b/src/vobsub/mpeg2/clock.rs
@@ -1,6 +1,7 @@
 use nom::{
     bits::complete::{tag, take},
-    IResult, Parser,
+    sequence::Tuple,
+    IResult,
 };
 use std::fmt;
 
--- a/src/vobsub/mpeg2/pes.rs
+++ b/src/vobsub/mpeg2/pes.rs
@@ -4,18 +4,16 @@
 //! in a `*.sub` file.
 
 use nom::{
-    bits::{
-        self, bits,
-        complete::{tag as tag_bits, take},
-    },
+    bits,
+    bits::complete::{tag as tag_bits, take},
     branch::alt,
     bytes::complete::tag as tag_bytes,
     combinator::{map, rest, value},
     multi::length_value,
     number::complete::{be_u16, be_u8},
     //do_parse, length_value, named, rest,
+    sequence::Tuple,
     IResult,
-    Parser,
 };
 use std::fmt;
 
@@ -45,8 +43,7 @@
         value(PtsDtsFlags::None, tag_bits(0b00, 2u8)),
         value(PtsDtsFlags::Pts, tag_bits(0b10, 2u8)),
         value(PtsDtsFlags::PtsDts, tag_bits(0b11, 2u8)),
-    ))
-    .parse(input)
+    ))(input)
 }
 
 /// Presentation and Decode Time Stamps, if available.
@@ -106,7 +103,7 @@
 
 /// Deserialize a single Boolean flag bit.
 fn bool_flag(input: (&[u8], usize)) -> IResult<(&[u8], usize), bool> {
-    map(|input| bits::complete::take(1u8)(input), |b: u8| b == 1).parse(input)
+    map(|input| bits::complete::take(1u8)(input), |b: u8| b == 1)(input)
 }
 
 /// Deserialize `HeaderDataFlags`
@@ -165,8 +162,7 @@
     // call `header_data_fields` to do the actual parse.  This ensures
     // that if `header_data_fields` doesn't parse all the header data,
     // we discard the rest before continuing.
-    let (input, pts_dts) =
-        length_value(be_u8, |input| pts_dts(input, flags.pts_dts_flags)).parse(input)?;
+    let (input, pts_dts) = length_value(be_u8, |input| pts_dts(input, flags.pts_dts_flags))(input)?;
     Ok((input, HeaderData { flags, pts_dts }))
 }
 
@@ -250,8 +246,7 @@
 }
 
 pub fn packet(input: &[u8]) -> IResult<&[u8], Packet> {
-    const PACKET_TAG: &[u8] = &[0x00, 0x00, 0x01, 0xbd];
-    let packet_tag = tag_bytes(PACKET_TAG);
+    let packet_tag = tag_bytes(&[0x00, 0x00, 0x01, 0xbd]);
     let packet_data = length_value(be_u16, packet_helper);
     let (input, (_, packet)) = (packet_tag, packet_data).parse(input)?;
 
--- a/src/vobsub/mpeg2/ps.rs
+++ b/src/vobsub/mpeg2/ps.rs
@@ -9,7 +9,8 @@
         complete::{tag as tag_bits, take as take_bits},
     },
     bytes::complete::tag as tag_bytes,
-    IResult, Parser,
+    sequence::Tuple,
+    IResult,
 };
 use std::fmt;
 
@@ -44,8 +45,7 @@
 /// Parse a Program Stream header.
 pub fn header(input: &[u8]) -> IResult<&[u8], Header> {
     // Sync bytes.
-    const PS_HEADER_TAG: &[u8] = &[0x00, 0x00, 0x01, 0xba];
-    let tag1 = tag_bytes(PS_HEADER_TAG);
+    let tag1 = tag_bytes(&[0x00, 0x00, 0x01, 0xba]);
 
     // 10-byte header.
     let header_parse = bits(|input| {
--- a/src/vobsub/palette.rs
+++ b/src/vobsub/palette.rs
@@ -3,7 +3,8 @@
     bytes::complete::{tag, take_while_m_n},
     combinator::map_res,
     multi::separated_list0,
-    IResult, Parser,
+    sequence::tuple,
+    IResult,
 };
 
 use super::VobSubError;
@@ -38,13 +39,12 @@
     map_res(
         take_while_m_n(2, 2, |c: u8| c.is_ascii_hexdigit()),
         from_hex,
-    )
-    .parse(input)
+    )(input)
 }
 
 /// Parse a 3-byte hexadecimal `RGB` color.
 fn hex_rgb(input: &[u8]) -> IResult<&[u8], Rgb<u8>> {
-    let (input, (red, green, blue)) = (hex_primary, hex_primary, hex_primary).parse(input)?;
+    let (input, (red, green, blue)) = tuple((hex_primary, hex_primary, hex_primary))(input)?;
 
     Ok((input, Rgb([red, green, blue])))
 }
@@ -57,21 +57,16 @@
 ///
 /// Will return `Err` if the input don't have 16 entries.
 pub fn palette(input: &[u8]) -> IResult<&[u8], Palette> {
-    const SEPARATOR_TAG: &[u8] = b", ";
-    let res = map_res(
-        separated_list0(tag(SEPARATOR_TAG), hex_rgb),
-        |vec: Vec<Rgb<u8>>| {
-            if vec.len() != 16 {
-                return Err(VobSubError::PaletteInvalidEntriesNumbers(vec.len()));
-            }
-            // Coerce vector to known-size slice.  Based on
-            // http://stackoverflow.com/q/25428920/12089.
-            let mut result = [Rgb([0, 0, 0]); 16];
-            <[Rgb<u8>; 16] as AsMut<_>>::as_mut(&mut result).clone_from_slice(&vec[0..16]);
-            Ok(result)
-        },
-    )
-    .parse(input);
+    let res = map_res(separated_list0(tag(b", "), hex_rgb), |vec: Vec<Rgb<u8>>| {
+        if vec.len() != 16 {
+            return Err(VobSubError::PaletteInvalidEntriesNumbers(vec.len()));
+        }
+        // Coerce vector to known-size slice.  Based on
+        // http://stackoverflow.com/q/25428920/12089.
+        let mut result = [Rgb([0, 0, 0]); 16];
+        <[Rgb<u8>; 16] as AsMut<_>>::as_mut(&mut result).clone_from_slice(&vec[0..16]);
+        Ok(result)
+    })(input);
     res
 }
 
--- a/src/vobsub/sub.rs
+++ b/src/vobsub/sub.rs
@@ -23,8 +23,8 @@
     combinator::{map, value},
     multi::{count, many_till},
     number::complete::be_u16,
-    sequence::preceded,
-    IResult, Parser,
+    sequence::{preceded, Tuple},
+    IResult,
 };
 use std::{
     cmp::Ordering, fmt::Debug, fs, io::Read, iter::FusedIterator, marker::PhantomData, path::Path,
@@ -208,13 +208,12 @@
             take_until(ControlCommandTag::End.as_slice()),
             ControlCommand::Unsupported,
         ),
-    ))
-    .parse(input)
+    ))(input)
 }
 
 /// The end of a control sequence.
 fn control_command_end(input: &[u8]) -> IResult<&[u8], &[u8]> {
-    tag_bytes(ControlCommandTag::End.as_slice()).parse(input)
+    tag_bytes(ControlCommandTag::End.as_slice())(input)
 }
 
 /// The control packet for a subtitle.
