Sweep the pinned toolchain to Rust 1.97

The Windows UI needs current winsafe, whose real minimum is 1.89 (its manifest
under-declares 1.87 while it uses NonNull::from_ref). Rather than stop at the
minimum, this goes to current stable and fixes what that costs.

The counter-intuitive result: 1.97 is CHEAPER than 1.89. libfreemkv had 54
clippy errors at 1.89 and 6 at 1.97, because clippy tightened the noisy
collapsible_if lint in between. Stopping at the minimum would have been the most
expensive choice available.

Roughly 47 lints across the eight repos, the large majority auto-fixed:
libfreemkv 6, freemkv-engine 14, bdemu 8, freemkv-keysources 7, autorip 6,
freemkv-unlock 3, freemkv-i18n 3. The hand-fixed ones are a descending sort to
sort_by_key(Reverse), four manual checked-division sites, a loop counter replaced
by enumerate, and a loop whose first let-else became a while-let.

Worth recording for whoever bumps next: clippy is MSRV-AWARE. Those 54 lints only
appear once the crate DECLARES 1.89 or later, because let-chains become
available. A bare `cargo +1.89 clippy` against a manifest still pinned at 1.87
reports clean and is meaningless — gate with the real precommit script, which is
also the only thing that covers build scripts.

The pin still sits below the Mac default, so it keeps doing its job: catching
lint drift locally before CI sees it.
This commit is contained in:
Matthew Jackson
2026-07-29 21:00:55 -07:00
parent a32373ff40
commit 5f8dc392c0
48 changed files with 444 additions and 452 deletions
+3 -5
View File
@@ -159,11 +159,9 @@ fn parse_eac3(f: &[u8]) -> Option<DolbyConfig> {
// samples at sample_rate. rate = bytes·8·sr / samples / 1000.
let frame_bytes = (frmsiz as u64 + 1) * 2;
let samples = blocks as u64 * 256;
let data_rate_kbps = if samples > 0 {
((frame_bytes * 8 * sample_rate as u64) / samples / 1000) as u16
} else {
0
};
let data_rate_kbps = (frame_bytes * 8 * sample_rate as u64)
.checked_div(samples)
.map_or(0, |r| (r / 1000) as u16);
Some(DolbyConfig {
fscod,
+11 -8
View File
@@ -285,11 +285,13 @@ impl<W: Write + Seek> Mp4Sink<W> {
let mut tracks = Vec::new();
let mut route = vec![None; title.streams.len()];
let mut next_id = 1u32;
let mut video_codec = Codec::Hevc;
for &i in &report.included {
let track_id = next_id;
next_id += 1;
// Track ids are 1-based and assigned in inclusion order. `moov`'s
// next_track_id is NOT derived from this counter — it is max(track_id) + 1
// computed after the sample-less retain, since ids are handed out here
// before any track is dropped.
for (n, &i) in report.included.iter().enumerate() {
let track_id = n as u32 + 1;
route[i] = Some(tracks.len());
match &title.streams[i] {
DiscStream::Video(v) => {
@@ -440,10 +442,11 @@ impl<W: Write + Seek + Send> Stream for Mp4Sink<W> {
// cost us the frame. Dropping leading frames here lost audio silently, and
// a track whose frames never parsed vanished from the output entirely with
// no report; finish() now decides that case loudly instead.
if self.tracks[slot].media == Media::Audio && self.tracks[slot].audio_entry.is_none() {
if let Some(entry) = audio::dolby_sample_entry(self.tracks[slot].codec, &frame.data) {
self.tracks[slot].audio_entry = Some(entry);
}
if self.tracks[slot].media == Media::Audio
&& self.tracks[slot].audio_entry.is_none()
&& let Some(entry) = audio::dolby_sample_entry(self.tracks[slot].codec, &frame.data)
{
self.tracks[slot].audio_entry = Some(entry);
}
let pts_ns = frame.pts;
let offset = self.mdat_start + 16 + self.mdat_payload;