Skip to content

Commit

Permalink
clock: change num primitive type to usize in nom call
Browse files Browse the repository at this point in the history
This fix build error on 32bit platform
where ToUsize is not implemented for u64.

Bug reported by @jonassmedegaard
  • Loading branch information
gwen-lg committed Apr 12, 2024
1 parent 21192c2 commit 611f51e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vobsub/mpeg2/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ impl fmt::Display for Clock {

/// Parse a 33-bit `Clock` value with 3 marker bits, consuming 36 bits.
pub fn clock(i: (&[u8], usize)) -> IResult<(&[u8], usize), Clock> {
let marker = tag(0b1, 1u8);
let hi_p = take(3u64);
let mid_p = take(15u64);
let lo_p = take(15u64);
let marker = tag(0b1, 1usize);
let hi_p = take(3usize);
let mid_p = take(15usize);
let lo_p = take(15usize);

let (input, (hi, _, mid, _, lo, _)): ((&[u8], usize), (u64, _, u64, _, u64, _)) =
(hi_p, &marker, mid_p, &marker, lo_p, &marker).parse(i)?;
Expand Down

0 comments on commit 611f51e

Please sign in to comment.