Skip to content

Commit dfad841

Browse files
committed
chore: Migrate to Rust 2024 edition (MSRV 1.85).
1 parent 59fd1ea commit dfad841

File tree

109 files changed

+225
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+225
-363
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ members = [
2424
]
2525

2626
[workspace.package]
27-
edition = "2021"
27+
edition = "2024"
2828
homepage = "https://github.com/pdeljanov/Symphonia"
2929
license = "MPL-2.0"
3030
license-file = "LICENSE"
3131
repository = "https://github.com/pdeljanov/Symphonia"
32-
rust-version = "1.77"
32+
rust-version = "1.85"
3333
version = "0.6.0"

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
# they're instructive to the reader and improve the code aesthetics.
4040
#
4141
# --------------------------------------------------------------------------------------------------
42-
msrv = "1.77"
42+
msrv = "1.85"

symphonia-bundle-flac/src/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use symphonia_common::xiph::audio::flac::StreamInfo;
1313
use symphonia_core::audio::{
1414
AsGenericAudioBufferRef, AudioBuffer, AudioMut, AudioSpec, GenericAudioBufferRef,
1515
};
16+
use symphonia_core::codecs::CodecInfo;
1617
use symphonia_core::codecs::audio::well_known::CODEC_ID_FLAC;
1718
use symphonia_core::codecs::audio::{AudioCodecParameters, AudioDecoderOptions};
1819
use symphonia_core::codecs::audio::{AudioDecoder, FinalizeResult, VerificationCheck};
1920
use symphonia_core::codecs::registry::{RegisterableAudioDecoder, SupportedAudioCodec};
20-
use symphonia_core::codecs::CodecInfo;
21-
use symphonia_core::errors::{decode_error, unsupported_error, Error, Result};
21+
use symphonia_core::errors::{Error, Result, decode_error, unsupported_error};
2222
use symphonia_core::formats::Packet;
2323
use symphonia_core::io::{BitReaderLtr, BufReader, ReadBitsLtr};
2424
use symphonia_core::support_audio_codec;

symphonia-bundle-flac/src/demuxer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use std::io::{Seek, SeekFrom};
1010
use symphonia_core::support_format;
1111

1212
use symphonia_common::xiph::audio::flac::{MetadataBlockHeader, MetadataBlockType, StreamInfo};
13+
use symphonia_core::codecs::CodecParameters;
1314
use symphonia_core::codecs::audio::{
14-
well_known::CODEC_ID_FLAC, AudioCodecParameters, VerificationCheck,
15+
AudioCodecParameters, VerificationCheck, well_known::CODEC_ID_FLAC,
1516
};
16-
use symphonia_core::codecs::CodecParameters;
1717
use symphonia_core::errors::{
18-
decode_error, seek_error, unsupported_error, Error, Result, SeekErrorKind,
18+
Error, Result, SeekErrorKind, decode_error, seek_error, unsupported_error,
1919
};
2020
use symphonia_core::formats::prelude::*;
2121
use symphonia_core::formats::probe::{ProbeFormatData, ProbeableFormat, Score, Scoreable};

symphonia-bundle-flac/src/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77

88
use symphonia_core::checksum::Crc8Ccitt;
9-
use symphonia_core::errors::{decode_error, Result};
9+
use symphonia_core::errors::{Result, decode_error};
1010
use symphonia_core::io::{Monitor, MonitorStream, ReadBytes};
1111

1212
/// The minimum FLAC frame header size including the sync bytes.

symphonia-bundle-mp3/src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// License, v. 2.0. If a copy of the MPL was not distributed with this
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77

8-
use symphonia_core::audio::{layouts, AudioBuffer, AudioSpec, Channels, Position};
9-
use symphonia_core::codecs::audio::well_known::{CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3};
8+
use symphonia_core::audio::{AudioBuffer, AudioSpec, Channels, Position, layouts};
109
use symphonia_core::codecs::audio::AudioCodecId;
10+
use symphonia_core::codecs::audio::well_known::{CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3};
1111
use symphonia_core::errors::Result;
1212

1313
use symphonia_core::io::BufReader;

symphonia-bundle-mp3/src/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77

88
use symphonia_core::audio::{AsGenericAudioBufferRef, Audio, AudioBuffer, GenericAudioBufferRef};
9+
use symphonia_core::codecs::CodecInfo;
910
use symphonia_core::codecs::audio::{
1011
AudioCodecId, AudioCodecParameters, AudioDecoder, AudioDecoderOptions, FinalizeResult,
1112
};
1213
use symphonia_core::codecs::registry::{RegisterableAudioDecoder, SupportedAudioCodec};
13-
use symphonia_core::codecs::CodecInfo;
14-
use symphonia_core::errors::{decode_error, unsupported_error, Result};
14+
use symphonia_core::errors::{Result, decode_error, unsupported_error};
1515
use symphonia_core::formats::Packet;
1616
use symphonia_core::io::FiniteStream;
1717
use symphonia_core::support_audio_codec;

symphonia-bundle-mp3/src/demuxer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
use symphonia_core::support_format;
99

1010
use symphonia_core::checksum::Crc16AnsiLe;
11-
use symphonia_core::codecs::audio::well_known::{CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3};
12-
use symphonia_core::codecs::audio::AudioCodecParameters;
1311
use symphonia_core::codecs::CodecParameters;
14-
use symphonia_core::errors::{seek_error, Error, Result, SeekErrorKind};
12+
use symphonia_core::codecs::audio::AudioCodecParameters;
13+
use symphonia_core::codecs::audio::well_known::{CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3};
14+
use symphonia_core::errors::{Error, Result, SeekErrorKind, seek_error};
1515
use symphonia_core::formats::prelude::*;
1616
use symphonia_core::formats::probe::{ProbeFormatData, ProbeableFormat, Score, Scoreable};
1717
use symphonia_core::formats::well_known::{FORMAT_ID_MP1, FORMAT_ID_MP2, FORMAT_ID_MP3};
@@ -857,7 +857,7 @@ fn try_read_info_tag_inner(buf: &[u8], header: &FrameHeader) -> Result<Option<Xi
857857
};
858858

859859
// If there is no CRC, then assume the tag is correct. Otherwise, use the CRC.
860-
let is_tag_ok = crc.map_or(true, |crc| crc == reader.monitor().crc());
860+
let is_tag_ok = crc.is_none_or(|crc| crc == reader.monitor().crc());
861861

862862
if is_tag_ok {
863863
// The CRC matched or is not present.

symphonia-bundle-mp3/src/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// License, v. 2.0. If a copy of the MPL was not distributed with this
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77

8-
use symphonia_core::errors::{decode_error, unsupported_error, Result};
8+
use symphonia_core::errors::{Result, decode_error, unsupported_error};
99
use symphonia_core::io::ReadBytes;
1010

1111
use crate::common::*;

symphonia-bundle-mp3/src/layer1/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77

88
use symphonia_core::audio::{AudioBuffer, AudioMut};
9-
use symphonia_core::errors::{decode_error, Result};
9+
use symphonia_core::errors::{Result, decode_error};
1010
use symphonia_core::io::{BitReaderLtr, BufReader, ReadBitsLtr, ReadBytes};
1111
use symphonia_core::util::bits::sign_extend_leq32_to_i32;
1212

@@ -70,6 +70,7 @@ impl Layer1 {
7070
}
7171

7272
impl Layer for Layer1 {
73+
#[allow(clippy::needless_range_loop)]
7374
fn decode(
7475
&mut self,
7576
reader: &mut BufReader<'_>,
@@ -111,6 +112,7 @@ impl Layer for Layer1 {
111112
}
112113

113114
// Read bit allocations for the intensity coded sub-bands.
115+
// NOTE: This loop causes a false positive with clippy.
114116
for sb in bound..32 {
115117
let bits = bs.read_bits_leq32(4)? as u8;
116118

0 commit comments

Comments
 (0)