From bbfbac7c243418883d997544a574e72b37270b24 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 13:55:40 -0700 Subject: [PATCH 01/21] Extract lint settings into Cargo.toml --- Cargo.toml | 28 ++++++++++++++++++++++++++++ clippy.toml | 43 +------------------------------------------ 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 835ab02b..a4ab03a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,31 @@ members = [ "symphonia-play", "symphonia-check", ] + +[workspace.lints.rust] +rust_2018_idioms = { level = "warn", priority = -1 } +unsafe_code = "forbid" +deprecated-safe = "forbid" + +[workspace.lints.clippy] +# Justification: +# Where possible, expressing an algorithm as closely as possible to the specification is +# preferrable. Rewriting using range syntax provides marginal benefit, but could be confusing. +manual_range_contains = "allow" + +# Justification: +# There is a performance penalty associated with the recommended idiom. +comparison_chain = "allow" + +# Justification: +# Floating point constants provided by specifications and papers often provide extra digits that +# are truncated when using 32-bit floating point airthmetic. By keeping this precision, we can use +# the values provided directly & without modification, and, when investigating accuracy issues, +# we can easily switch to 64-bit floating point arithmetic and benefit from the higher precision. +excessive_precision = "allow" + +# Justification: +# Sometimes the base or initial case of an unrolled multi-iteration/step mathematical expression +# contains operations that are otherwise no-ops. Disable the warning for these expressions because +# they're instructive to the reader and improve the code aesthetics. +identity_op = "allow" diff --git a/clippy.toml b/clippy.toml index 5b6bbe0d..65f527ae 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,42 +1 @@ -# The following lints are ALLOWED in all Symphonia crates. -# -# -------------------------------------------------------------------------------------------------- -# -# Lint: -# clippy::manual_range_contains -# -# Justification: -# Where possible, expressing an algorithm as closely as possible to the specification is -# preferrable. Rewriting using range syntax provides marginal benefit, but could be confusing. -# -# -------------------------------------------------------------------------------------------------- -# -# Lint: -# clippy::comparison_chain -# -# Justification: -# There is a performance penalty associated with the recommended idiom. -# -# -------------------------------------------------------------------------------------------------- -# -# Lint: -# clippy::excessive_precision -# -# Justification: -# Floating point constants provided by specifications and papers often provide extra digits that -# are truncated when using 32-bit floating point airthmetic. By keeping this precision, we can use -# the values provided directly & without modification, and, when investigating accuracy issues, -# we can easily switch to 64-bit floating point arithmetic and benefit from the higher precision. -# -# -------------------------------------------------------------------------------------------------- -# -# Lint: -# clippy::identity_op -# -# Justification: -# Sometimes the base or initial case of an unrolled multi-iteration/step mathematical expression -# contains operations that are otherwise no-ops. Disable the warning for these expressions because -# they're instructive to the reader and improve the code aesthetics. -# -# -------------------------------------------------------------------------------------------------- -msrv = "1.77" \ No newline at end of file +msrv = "1.77" From 34b37cb17401ddcdc0f3693273ae79f06e5a37de Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 14:08:38 -0700 Subject: [PATCH 02/21] Use workspace lints in symphonia-play --- symphonia-play/Cargo.toml | 3 +++ symphonia-play/src/main.rs | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/symphonia-play/Cargo.toml b/symphonia-play/Cargo.toml index 8f38316b..d251cf53 100644 --- a/symphonia-play/Cargo.toml +++ b/symphonia-play/Cargo.toml @@ -11,6 +11,9 @@ rust-version = "1.77" publish = false default-run = "symphonia-play" +[lints] +workspace = true + [dependencies] clap = "3.1.0" lazy_static = "1.4.0" diff --git a/symphonia-play/src/main.rs b/symphonia-play/src/main.rs index 7dd624c3..d753bb41 100644 --- a/symphonia-play/src/main.rs +++ b/symphonia-play/src/main.rs @@ -5,8 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] // Justification: Fields on DecoderOptions and FormatOptions may change at any time, but // symphonia-play doesn't want to be updated every time those fields change, therefore always fill // in the remaining fields with default values. From 689e841cbf69b01344e9edde1f6c2a4b2cbdfc35 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 16:08:09 -0700 Subject: [PATCH 03/21] Use workspace lints in symphonia-metadata --- symphonia-metadata/Cargo.toml | 3 +++ symphonia-metadata/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/symphonia-metadata/Cargo.toml b/symphonia-metadata/Cargo.toml index 00dca01a..0d2298ce 100644 --- a/symphonia-metadata/Cargo.toml +++ b/symphonia-metadata/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["multimedia", "media", "metadata", "id3v1", "id3v2"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [features] default = ["ape", "id3v1", "id3v2"] diff --git a/symphonia-metadata/src/lib.rs b/symphonia-metadata/src/lib.rs index 0dc126f0..f89d08d5 100644 --- a/symphonia-metadata/src/lib.rs +++ b/symphonia-metadata/src/lib.rs @@ -22,15 +22,6 @@ //! An embedded metadata format is one that is embedded into the media container. This crate //! implements reading or parsing functions for these metadata formats in the [`embedded`] module. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - #[cfg(feature = "ape")] pub mod ape; #[cfg(feature = "id3v1")] From 39d330f5a49885dd87d2a2718757206062288970 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 16:10:46 -0700 Subject: [PATCH 04/21] Use workspace lints in symphonia-format-riff --- symphonia-format-riff/Cargo.toml | 3 +++ symphonia-format-riff/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/symphonia-format-riff/Cargo.toml b/symphonia-format-riff/Cargo.toml index 9abc0f50..4b843676 100644 --- a/symphonia-format-riff/Cargo.toml +++ b/symphonia-format-riff/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "media", "demuxer", "aiff", "wav"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [features] default = ["aiff", "wav"] aiff = [] diff --git a/symphonia-format-riff/src/lib.rs b/symphonia-format-riff/src/lib.rs index 6b8d608d..1b58861f 100644 --- a/symphonia-format-riff/src/lib.rs +++ b/symphonia-format-riff/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod common; #[cfg(feature = "aiff")] From c3c680bd68f088adff90caac3d955b158783ba89 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 19:54:10 -0700 Subject: [PATCH 05/21] Use workspace lints in symphonia-format-ogg --- Cargo.toml | 1 + symphonia-format-ogg/Cargo.toml | 6 +++--- symphonia-format-ogg/src/lib.rs | 9 --------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4ab03a2..dbe1e8a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ members = [ rust_2018_idioms = { level = "warn", priority = -1 } unsafe_code = "forbid" deprecated-safe = "forbid" +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } [workspace.lints.clippy] # Justification: diff --git a/symphonia-format-ogg/Cargo.toml b/symphonia-format-ogg/Cargo.toml index a18a9183..0a18fe24 100644 --- a/symphonia-format-ogg/Cargo.toml +++ b/symphonia-format-ogg/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "media", "demuxer", "ogg"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } @@ -22,6 +25,3 @@ version = "0.5.4" path = "../symphonia-metadata" default-features = false features = ["vorbis"] - -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } \ No newline at end of file diff --git a/symphonia-format-ogg/src/lib.rs b/symphonia-format-ogg/src/lib.rs index 39bb2218..e9b4cfd6 100644 --- a/symphonia-format-ogg/src/lib.rs +++ b/symphonia-format-ogg/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod common; mod demuxer; mod logical; From 186f1f3444d19c5d4d96055b7bb6285bb48d5804 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 19:59:48 -0700 Subject: [PATCH 06/21] Use workspace lints in symphonia-format-mkv --- symphonia-format-mkv/Cargo.toml | 5 ++++- symphonia-format-mkv/src/lib.rs | 9 --------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/symphonia-format-mkv/Cargo.toml b/symphonia-format-mkv/Cargo.toml index bda3ebae..d6ca4394 100644 --- a/symphonia-format-mkv/Cargo.toml +++ b/symphonia-format-mkv/Cargo.toml @@ -12,8 +12,11 @@ keywords = ["media", "demuxer", "mkv", "matroska", "webm"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" lazy_static = "1.4.0" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } -symphonia-common = { version = "0.5.4", path = "../symphonia-common" } \ No newline at end of file +symphonia-common = { version = "0.5.4", path = "../symphonia-common" } diff --git a/symphonia-format-mkv/src/lib.rs b/symphonia-format-mkv/src/lib.rs index 538ed99a..b9d2b342 100644 --- a/symphonia-format-mkv/src/lib.rs +++ b/symphonia-format-mkv/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod codecs; mod demuxer; mod ebml; From ccb9beba1469cd1c22753a7661a55f528ce028c5 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:01:13 -0700 Subject: [PATCH 07/21] Use workspace lints in symphonia-format-isomp4 --- symphonia-format-isomp4/Cargo.toml | 3 +++ symphonia-format-isomp4/src/lib.rs | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/symphonia-format-isomp4/Cargo.toml b/symphonia-format-isomp4/Cargo.toml index bab8c011..384ee8ae 100644 --- a/symphonia-format-isomp4/Cargo.toml +++ b/symphonia-format-isomp4/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "media", "demuxer", "mp4", "iso"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } diff --git a/symphonia-format-isomp4/src/lib.rs b/symphonia-format-isomp4/src/lib.rs index 573c7a9f..6fb3d12f 100644 --- a/symphonia-format-isomp4/src/lib.rs +++ b/symphonia-format-isomp4/src/lib.rs @@ -5,14 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod atoms; mod demuxer; mod fp; From c8e50aab72b4feb6562a90089e8221add338d4bc Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:02:09 -0700 Subject: [PATCH 08/21] Use workspace lints in symphonia-format-caf --- symphonia-format-caf/Cargo.toml | 3 +++ symphonia-format-caf/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/symphonia-format-caf/Cargo.toml b/symphonia-format-caf/Cargo.toml index 5f760b1d..9ff101cc 100644 --- a/symphonia-format-caf/Cargo.toml +++ b/symphonia-format-caf/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "media", "demuxer", "caf"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } diff --git a/symphonia-format-caf/src/lib.rs b/symphonia-format-caf/src/lib.rs index 15320ac7..24907c53 100644 --- a/symphonia-format-caf/src/lib.rs +++ b/symphonia-format-caf/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod chunks; mod demuxer; From 02f58857f6702303ece9850ab3ec74e49d0654f3 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:02:58 -0700 Subject: [PATCH 09/21] Use workspace lints in symphonia-core --- symphonia-core/Cargo.toml | 11 +++++------ symphonia-core/src/lib.rs | 7 ------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/symphonia-core/Cargo.toml b/symphonia-core/Cargo.toml index ce22c026..1ebbd5ed 100644 --- a/symphonia-core/Cargo.toml +++ b/symphonia-core/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "multimedia", "media"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [features] default = [] @@ -21,11 +24,7 @@ opt-simd-avx = ["rustfft/avx"] opt-simd-neon = ["rustfft/neon"] # Enable all SIMD support. -opt-simd = [ - "opt-simd-sse", - "opt-simd-avx", - "opt-simd-neon", -] +opt-simd = ["opt-simd-sse", "opt-simd-avx", "opt-simd-neon"] [dependencies] bitflags = "2.4.2" @@ -38,4 +37,4 @@ smallvec = "1.13.1" [dependencies.rustfft] version = "6.1.0" optional = true -default-features = false \ No newline at end of file +default-features = false diff --git a/symphonia-core/src/lib.rs b/symphonia-core/src/lib.rs index a1025d15..3a6f70fe 100644 --- a/symphonia-core/src/lib.rs +++ b/symphonia-core/src/lib.rs @@ -4,13 +4,6 @@ // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] pub mod audio; pub mod checksum; From 9fa4c0776e16a787a7171ca10e8604c2338c4291 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:03:55 -0700 Subject: [PATCH 10/21] Use workspace lints in symphonia-common --- symphonia-common/Cargo.toml | 5 ++++- symphonia-common/src/lib.rs | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/symphonia-common/Cargo.toml b/symphonia-common/Cargo.toml index fcfddd4c..911fcadd 100644 --- a/symphonia-common/Cargo.toml +++ b/symphonia-common/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "multimedia", "media", "xiph"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] symphonia-core = { version = "0.5.4", path = "../symphonia-core" } @@ -19,4 +22,4 @@ symphonia-core = { version = "0.5.4", path = "../symphonia-core" } version = "0.5.4" path = "../symphonia-metadata" default-features = false -features = ["flac"] \ No newline at end of file +features = ["flac"] diff --git a/symphonia-common/src/lib.rs b/symphonia-common/src/lib.rs index 40d872fe..a3fa1cae 100644 --- a/symphonia-common/src/lib.rs +++ b/symphonia-common/src/lib.rs @@ -5,12 +5,5 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - pub mod mpeg; pub mod xiph; From 4444d355ce44d6400243e1364d745d92b8cf4000 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:04:19 -0700 Subject: [PATCH 11/21] Use workspace lints in symphonia-codec-wavpack --- symphonia-codec-wavpack/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/symphonia-codec-wavpack/Cargo.toml b/symphonia-codec-wavpack/Cargo.toml index c7b8f04b..06567191 100644 --- a/symphonia-codec-wavpack/Cargo.toml +++ b/symphonia-codec-wavpack/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "wavpack"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" -symphonia-core = { version = "0.5.4", path = "../symphonia-core" } \ No newline at end of file +symphonia-core = { version = "0.5.4", path = "../symphonia-core" } From 6727225bff17e1906ff635d51f0378ae0a605ce9 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:05:55 -0700 Subject: [PATCH 12/21] Use workspace lints in symphonia-codec-vorbis --- symphonia-codec-vorbis/Cargo.toml | 5 ++++- symphonia-codec-vorbis/src/lib.rs | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/symphonia-codec-vorbis/Cargo.toml b/symphonia-codec-vorbis/Cargo.toml index 7a5bd0dc..a6bbf9f5 100644 --- a/symphonia-codec-vorbis/Cargo.toml +++ b/symphonia-codec-vorbis/Cargo.toml @@ -12,7 +12,10 @@ keywords = ["audio", "codec", "decoder", "vorbis"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } -symphonia-common = { version = "0.5.4", path = "../symphonia-common" } \ No newline at end of file +symphonia-common = { version = "0.5.4", path = "../symphonia-common" } diff --git a/symphonia-codec-vorbis/src/lib.rs b/symphonia-codec-vorbis/src/lib.rs index 019193b8..db388fc0 100644 --- a/symphonia-codec-vorbis/src/lib.rs +++ b/symphonia-codec-vorbis/src/lib.rs @@ -5,14 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] // Disable to better express the specification. #![allow(clippy::collapsible_else_if)] From 4ce942627244b42b5b3e8ec4498904381dc2a458 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:06:30 -0700 Subject: [PATCH 13/21] Use workspace lints in symphonia-codec-pcm --- symphonia-codec-pcm/Cargo.toml | 5 ++++- symphonia-codec-pcm/src/lib.rs | 9 --------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/symphonia-codec-pcm/Cargo.toml b/symphonia-codec-pcm/Cargo.toml index b4970327..16f6829c 100644 --- a/symphonia-codec-pcm/Cargo.toml +++ b/symphonia-codec-pcm/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "pcm"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" -symphonia-core = { version = "0.5.4", path = "../symphonia-core" } \ No newline at end of file +symphonia-core = { version = "0.5.4", path = "../symphonia-core" } diff --git a/symphonia-codec-pcm/src/lib.rs b/symphonia-codec-pcm/src/lib.rs index 7952869d..214ea720 100644 --- a/symphonia-codec-pcm/src/lib.rs +++ b/symphonia-codec-pcm/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - use symphonia_core::codecs::registry::{RegisterableAudioDecoder, SupportedAudioCodec}; use symphonia_core::codecs::CodecInfo; use symphonia_core::support_audio_codec; From 3f8784e0b85aaab3472bc735455198a55e8af533 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:07:00 -0700 Subject: [PATCH 14/21] Use workspace lints in symphonia-codec-opus --- symphonia-codec-opus/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/symphonia-codec-opus/Cargo.toml b/symphonia-codec-opus/Cargo.toml index efcce8e7..72c27da0 100644 --- a/symphonia-codec-opus/Cargo.toml +++ b/symphonia-codec-opus/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "opus"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } \ No newline at end of file From 6143b87163a01c3cef64bca1d094531fa1d26590 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:07:25 -0700 Subject: [PATCH 15/21] Use workspace lints in symphonia-codec-alac --- symphonia-codec-alac/Cargo.toml | 5 ++++- symphonia-codec-alac/src/lib.rs | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/symphonia-codec-alac/Cargo.toml b/symphonia-codec-alac/Cargo.toml index d228ce41..0a094770 100644 --- a/symphonia-codec-alac/Cargo.toml +++ b/symphonia-codec-alac/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "alac"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" -symphonia-core = { version = "0.5.4", path = "../symphonia-core" } \ No newline at end of file +symphonia-core = { version = "0.5.4", path = "../symphonia-core" } diff --git a/symphonia-codec-alac/src/lib.rs b/symphonia-codec-alac/src/lib.rs index ccb7d54f..e2286017 100644 --- a/symphonia-codec-alac/src/lib.rs +++ b/symphonia-codec-alac/src/lib.rs @@ -5,14 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] // Disable to better express the specification. #![allow(clippy::collapsible_else_if)] From 75d066c1f54ee09ddda6d3af57bca0fc142ff826 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:08:24 -0700 Subject: [PATCH 16/21] Use workspace lints in symphonia-codec-adpcm --- symphonia-codec-adpcm/Cargo.toml | 3 +++ symphonia-codec-adpcm/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/symphonia-codec-adpcm/Cargo.toml b/symphonia-codec-adpcm/Cargo.toml index a439bd3f..581c60f5 100644 --- a/symphonia-codec-adpcm/Cargo.toml +++ b/symphonia-codec-adpcm/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "adpcm"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } \ No newline at end of file diff --git a/symphonia-codec-adpcm/src/lib.rs b/symphonia-codec-adpcm/src/lib.rs index c4f2e8cf..a00c1e73 100644 --- a/symphonia-codec-adpcm/src/lib.rs +++ b/symphonia-codec-adpcm/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - use symphonia_core::codecs::registry::{RegisterableAudioDecoder, SupportedAudioCodec}; use symphonia_core::codecs::CodecInfo; use symphonia_core::support_audio_codec; From 14169da87b5ab69caca2b9593ef1d970ceeda7d5 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:09:20 -0700 Subject: [PATCH 17/21] Use workspace lints in symphonia-codec-aac --- symphonia-codec-aac/Cargo.toml | 3 +++ symphonia-codec-aac/src/lib.rs | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/symphonia-codec-aac/Cargo.toml b/symphonia-codec-aac/Cargo.toml index 6f8e14e4..02dc0872 100644 --- a/symphonia-codec-aac/Cargo.toml +++ b/symphonia-codec-aac/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "aac", "m4a"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" lazy_static = "1.4.0" diff --git a/symphonia-codec-aac/src/lib.rs b/symphonia-codec-aac/src/lib.rs index 34c8c9f8..e2337a3d 100644 --- a/symphonia-codec-aac/src/lib.rs +++ b/symphonia-codec-aac/src/lib.rs @@ -5,14 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] // TODO: Remove this when refactoring AAC. #![allow(clippy::needless_range_loop)] From ab7e8a6d3851e48717427fa0bdf86215494a56e9 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:10:30 -0700 Subject: [PATCH 18/21] Use workspace lints in symphonia-check --- symphonia-check/Cargo.toml | 3 +++ symphonia-check/src/main.rs | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/symphonia-check/Cargo.toml b/symphonia-check/Cargo.toml index 424127a9..7c152af0 100644 --- a/symphonia-check/Cargo.toml +++ b/symphonia-check/Cargo.toml @@ -10,6 +10,9 @@ edition = "2021" rust-version = "1.77" publish = false +[lints] +workspace = true + [dependencies] clap = "3.1.0" log = { version = "0.4", features = ["release_max_level_info"] } diff --git a/symphonia-check/src/main.rs b/symphonia-check/src/main.rs index 3121fe9e..47c7c1bc 100644 --- a/symphonia-check/src/main.rs +++ b/symphonia-check/src/main.rs @@ -5,8 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] // Justification: Fields on DecoderOptions and FormatOptions may change at any time, but // symphonia-check doesn't want to be updated every time those fields change, therefore always fill // in the remaining fields with default values. From 83663f2c8941320dc26b0cac1e794f5e1430b9d7 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:11:04 -0700 Subject: [PATCH 19/21] Use workspace lints in symphonia-bundle-mp3 --- symphonia-bundle-mp3/Cargo.toml | 3 +++ symphonia-bundle-mp3/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/symphonia-bundle-mp3/Cargo.toml b/symphonia-bundle-mp3/Cargo.toml index 94797828..8864f970 100644 --- a/symphonia-bundle-mp3/Cargo.toml +++ b/symphonia-bundle-mp3/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "mp3", "mpeg"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [features] default = ["mp1", "mp2", "mp3"] mp1 = [] diff --git a/symphonia-bundle-mp3/src/lib.rs b/symphonia-bundle-mp3/src/lib.rs index 7b8f9b83..f87d155e 100644 --- a/symphonia-bundle-mp3/src/lib.rs +++ b/symphonia-bundle-mp3/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - // Shared modules. mod common; mod header; From 5e376efc230a4941db98e8ec688d9d37e58b1a87 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:11:54 -0700 Subject: [PATCH 20/21] Use workspace lints in symphonia-bundle-flac --- symphonia-bundle-flac/Cargo.toml | 6 +++--- symphonia-bundle-flac/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/symphonia-bundle-flac/Cargo.toml b/symphonia-bundle-flac/Cargo.toml index 60c51250..ff465383 100644 --- a/symphonia-bundle-flac/Cargo.toml +++ b/symphonia-bundle-flac/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "flac"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [dependencies] log = "0.4" symphonia-core = { version = "0.5.4", path = "../symphonia-core" } @@ -22,6 +25,3 @@ version = "0.5.4" path = "../symphonia-metadata" default-features = false features = ["flac"] - -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } \ No newline at end of file diff --git a/symphonia-bundle-flac/src/lib.rs b/symphonia-bundle-flac/src/lib.rs index c1ffec2c..0665bbf6 100644 --- a/symphonia-bundle-flac/src/lib.rs +++ b/symphonia-bundle-flac/src/lib.rs @@ -5,15 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] -// The following lints are allowed in all Symphonia crates. Please see clippy.toml for their -// justification. -#![allow(clippy::comparison_chain)] -#![allow(clippy::excessive_precision)] -#![allow(clippy::identity_op)] -#![allow(clippy::manual_range_contains)] - mod decoder; mod demuxer; mod frame; From 265b0469fd5d27abe261bbf577af0b5b76997f58 Mon Sep 17 00:00:00 2001 From: Cass Fridkin Date: Thu, 2 Jan 2025 20:12:29 -0700 Subject: [PATCH 21/21] Use workspace lints in symphonia --- symphonia/Cargo.toml | 30 +++++++----------------------- symphonia/src/lib.rs | 3 --- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/symphonia/Cargo.toml b/symphonia/Cargo.toml index ce2306f8..c11e9564 100644 --- a/symphonia/Cargo.toml +++ b/symphonia/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["audio", "codec", "decoder", "multimedia", "media"] edition = "2021" rust-version = "1.77" +[lints] +workspace = true + [features] # Only royalty-free open standard codecs and formats are enabled by default. default = ["all-meta", "adpcm", "flac", "mkv", "ogg", "pcm", "vorbis", "wav"] @@ -53,28 +56,13 @@ all-codecs = [ ] # Enable all supported container formats. -all-formats = [ - "caf", - "isomp4", - "mkv", - "ogg", - "aiff", - "wav", -] +all-formats = ["caf", "isomp4", "mkv", "ogg", "aiff", "wav"] # Enable all supported standalone metadata formats. -all-meta = [ - "ape", - "id3v1", - "id3v2", -] +all-meta = ["ape", "id3v1", "id3v2"] # Enable all supported codecs and formats. -all = [ - "all-codecs", - "all-formats", - "all-meta", -] +all = ["all-codecs", "all-formats", "all-meta"] # SIMD support. opt-simd-sse = ["symphonia-core/opt-simd-sse"] @@ -82,11 +70,7 @@ opt-simd-avx = ["symphonia-core/opt-simd-avx"] opt-simd-neon = ["symphonia-core/opt-simd-neon"] # Enable all SIMD support. -opt-simd = [ - "opt-simd-sse", - "opt-simd-avx", - "opt-simd-neon", -] +opt-simd = ["opt-simd-sse", "opt-simd-avx", "opt-simd-neon"] [dependencies] lazy_static = "1.4.0" diff --git a/symphonia/src/lib.rs b/symphonia/src/lib.rs index a4e2d480..553452b5 100644 --- a/symphonia/src/lib.rs +++ b/symphonia/src/lib.rs @@ -5,9 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![warn(rust_2018_idioms)] -#![forbid(unsafe_code)] - //! # Project Symphonia //! //! Symphonia is a 100% pure Rust audio decoding and multimedia format demuxing framework.