Skip to content

Conversation

@rolandd
Copy link
Contributor

@rolandd rolandd commented Jan 7, 2026

Hi, happy new year. I'm finally, finally getting back to my CR3 code and I noticed
a few issues getting a clean build with the latest rust toolchain (and one caused by
not being in daylight saving time :)). Please take a look at these changes.

Thanks!

The test checks the parsing of "2023:07:09 20:36:33" but if the
test is run at a time and in a local timezone where July 9 and the
current date have a different daylight saving offset, then using
Local::now() to get the timezone offset will cause the second parsed
time to be an hour off of the original time.

Fix this by using the timezone from the first parsed time instead.
Newer "cargo clippy" complains:

    warning: hiding a lifetime that's elided elsewhere is confusing

for functions that take borrowed data as an input parameter and return
a BoxHolder that implicitly captures the lifetime. Add an anonymous
lifetime to improve the code as clippy suggests.
Clippy recently got the warning:

    warning: using `contains()` instead of `iter().any()` is more efficient

Make that change as suggested.
The definitions of these structs that are used are in iloc.rs, so
the meta.rs versions just cause dead code warnings. The duplicates
were part of the original commit of iloc.rs and meta.rs (commit
422b7fa / "Add source code") but were apparently never used.
The ConstructionMethod enum was previously unused and causing dead code
warnings. This commit wires it up properly:

- Store ConstructionMethod directly in ItemLocation (was Option<u8>)
- Convert at parse time using From<u8>
- Use exhaustive match expressions in meta.rs
- Remove the now-unused bbox::Error enum

Unknown construction method values are logged via tracing::warn before
defaulting to FileOffset, preserving visibility of unexpected data
while maintaining compatibility.
SkipBufRead was introduced in commit 3d77901 / "MediaParser API"
but was never instantiated anywhere in the crate.

It can't be used by external code because:

1. SkipBufRead uses a unit tuple constructor SkipBufRead(()) which is
   private - external code cannot construct instances
2. The Skip trait that would make SkipBufRead useful is not exported
   from the crate (lib.rs has 'pub(crate) use skip::{Seekable, Unseekable}')
3. There is no MediaSource constructor that would use SkipBufRead -
   only seekable() and unseekable() exist, which use Seekable and
   Unseekable respectively

Since the Skip infrastructure is entirely internal, it seems the best
fix for dead code warnings about it is just to remove it.
@mindeng mindeng merged commit 399bb34 into mindeng:main Jan 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants