diff --git a/Cargo.toml b/Cargo.toml index 835ab02b..dbe1e8a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,32 @@ members = [ "symphonia-play", "symphonia-check", ] + +[workspace.lints.rust] +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: +# 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" 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; 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; 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. 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)] 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; 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)] 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 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; 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)] 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" } 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; 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; 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; 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; 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; 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; 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")] 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")] 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. 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.