Skip to content

Commit

Permalink
Cleanup more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb committed Feb 20, 2024
1 parent 80be00d commit f3892d0
Show file tree
Hide file tree
Showing 22 changed files with 5 additions and 118 deletions.
8 changes: 0 additions & 8 deletions serde_with/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,6 @@ macro_rules! seq_impl {
$with_capacity:expr,
$append:ident
) => {
// Fix for clippy regression in macros on stable
// The bug no longer exists on nightly
// https://github.com/rust-lang/rust-clippy/issues/7768
#[allow(clippy::semicolon_if_nothing_returned)]
impl<'de, T, U $(, $typaram)*> DeserializeAs<'de, $ty<T $(, $typaram)*>> for $ty<U $(, $typaram)*>
where
U: DeserializeAs<'de, T>,
Expand Down Expand Up @@ -442,10 +438,6 @@ macro_rules! map_impl {
$ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >,
$with_capacity:expr
) => {
// Fix for clippy regression in macros on stable
// The bug no longer exists on nightly
// https://github.com/rust-lang/rust-clippy/issues/7768
#[allow(clippy::semicolon_if_nothing_returned)]
impl<'de, K, V, KU, VU $(, $typaram)*> DeserializeAs<'de, $ty<K, V $(, $typaram)*>> for $ty<KU, VU $(, $typaram)*>
where
KU: DeserializeAs<'de, K>,
Expand Down
1 change: 0 additions & 1 deletion serde_with/src/serde_conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ macro_rules! serde_conv {
$vis struct $m;

const _:() = {
#[allow(clippy::ptr_arg)]
impl $m {
$vis fn serialize<S>(x: &$t, serializer: S) -> $crate::__private__::Result<S::Ok, S::Error>
where
Expand Down
3 changes: 0 additions & 3 deletions serde_with/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ where
// TODO could be simplified with nightly maybe_uninit_uninit_array feature
// https://doc.rust-lang.org/nightly/std/mem/union.MaybeUninit.html#method.uninit_array

// Clippy is broken and has a false positive here
// https://github.com/rust-lang/rust-clippy/issues/10551
#[allow(clippy::uninit_assumed_init)]
let mut arr: [MaybeUninit<T>; N] = unsafe { MaybeUninit::uninit().assume_init() };

// Dropping a `MaybeUninit` does nothing. Thus using raw pointer
Expand Down
5 changes: 0 additions & 5 deletions serde_with/tests/base64.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
// This allows the tests to be written more uniform and not have to special case the last clone().
clippy::redundant_clone,
)]
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/chrono_0_4.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

extern crate alloc;

mod utils;
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/derives/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod deserialize_fromstr;
mod serialize_display;
#[path = "../utils.rs"]
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/hashbrown_0_14.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::{check_deserialization, check_error_deserialization, is_equal};
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/hex.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::{check_deserialization, check_error_deserialization, is_equal};
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/indexmap_1.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::{check_deserialization, check_error_deserialization, is_equal};
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/indexmap_2.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::{check_deserialization, check_error_deserialization, is_equal};
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/json.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::is_equal;
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/rust.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

extern crate alloc;

mod utils;
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/serde_as/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

extern crate alloc;

mod collections;
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/time_0_3.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

mod utils;

use crate::utils::{check_deserialization, check_error_deserialization, is_equal};
Expand Down
4 changes: 0 additions & 4 deletions serde_with/tests/version_numbers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Needed to suppress a 2021 incompatibility warning in the macro generated code
// The non_fmt_panic lint is not yet available on most Rust versions
#![allow(unknown_lints, non_fmt_panics)]

use version_sync::{assert_contains_regex, assert_html_root_url_updated};

#[test]
Expand Down
8 changes: 0 additions & 8 deletions serde_with/tests/with_prefix.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#![allow(
// clippy is broken and shows wrong warnings
// clippy on stable does not know yet about the lint name
unknown_lints,
// https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]

extern crate alloc;

mod utils;
Expand Down
4 changes: 0 additions & 4 deletions serde_with_macros/tests/version_numbers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Needed to supress a 2021 incompatability warning in the macro generated code
// The non_fmt_panic lint is not yet available on most Rust versions
#![allow(unknown_lints, non_fmt_panics)]

#[test]
fn test_html_root_url() {
version_sync::assert_html_root_url_updated!("src/lib.rs");
Expand Down
2 changes: 1 addition & 1 deletion serde_with_test/tests/derive_display_fromstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]
#![allow(dead_code)]

use ::s_with::{DeserializeFromStr, SerializeDisplay};

Expand Down
2 changes: 1 addition & 1 deletion serde_with_test/tests/flattened_maybe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]
#![allow(dead_code)]

// The macro creates custom deserialization code.
// You need to specify a function name and the field name of the flattened field.
Expand Down
2 changes: 1 addition & 1 deletion serde_with_test/tests/serde_as_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]
#![allow(dead_code)]

#[cfg_attr(test, ::cfg_eval::cfg_eval, ::s_with::serde_as(crate = "::s_with"))]
#[cfg_attr(test, derive(::s::Serialize, ::s::Deserialize))]
Expand Down
2 changes: 1 addition & 1 deletion serde_with_test/tests/serde_conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]
#![allow(dead_code)]

use ::s_with::serde_conv;

Expand Down
2 changes: 1 addition & 1 deletion serde_with_test/tests/with_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Ensure no prelude is available
#![no_implicit_prelude]
#![allow(dead_code, unused_imports)]
#![allow(dead_code)]

use ::s_with::with_prefix;

Expand Down

0 comments on commit f3892d0

Please sign in to comment.