Skip to content

Pallet Pass

Pallet Pass #15

GitHub Actions / clippy succeeded Oct 7, 2024 in 0s

clippy

22 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 22
Note 0
Help 0

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check warning on line 93 in pallets/referenda-tracks/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
  --> pallets/referenda-tracks/src/lib.rs:93:15
   |
93 |     #[pallet::pallet]
   |               ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
   = note: `#[warn(clippy::manual_inspect)]` on by default
help: try
   |
93 -     #[pallet::pallet]
93 +     #[pallet::&inspect_err]
   |

Check warning on line 86 in pallets/referenda-tracks/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

empty doc comment

warning: empty doc comment
  --> pallets/referenda-tracks/src/lib.rs:86:9
   |
86 |         ///
   |         ^^^
   |
   = help: consider removing or filling it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
   = note: `#[warn(clippy::empty_docs)]` on by default

Check warning on line 96 in pallets/referenda-tracks/src/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `()`

warning: useless conversion to the same type: `()`
  --> pallets/referenda-tracks/src/impls.rs:96:12
   |
96 |         Ok(().into())
   |            ^^^^^^^^^ help: consider removing `.into()`: `()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 96 in pallets/referenda-tracks/src/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

passing a unit value to a function

warning: passing a unit value to a function
  --> pallets/referenda-tracks/src/impls.rs:96:9
   |
96 |         Ok(().into())
   |         ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
   = note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
   |
96 ~         ().into();
97 +         Ok(())
   |

Check warning on line 41 in pallets/referenda-tracks/src/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

binary comparison to literal `Option::None`

warning: binary comparison to literal `Option::None`
  --> pallets/referenda-tracks/src/impls.rs:41:13
   |
41 |             Tracks::<T, I>::get(id) == None,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `Tracks::<T, I>::get(id).is_none()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
   = note: `#[warn(clippy::partialeq_to_none)]` on by default

Check warning on line 86 in pallets/referenda-tracks/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<T as Config<I>>::TrackId` which implements the `Copy` trait

warning: using `clone` on type `<T as Config<I>>::TrackId` which implements the `Copy` trait
  --> pallets/referenda-tracks/src/benchmarking.rs:86:57
   |
86 |         OriginToTrackId::<T, I>::insert(origin.clone(), id.clone());
   |                                                         ^^^^^^^^^^ help: try dereferencing it: `*id`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 85 in pallets/referenda-tracks/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `<T as Config<I>>::TrackId` which implements the `Copy` trait

warning: using `clone` on type `<T as Config<I>>::TrackId` which implements the `Copy` trait
  --> pallets/referenda-tracks/src/benchmarking.rs:85:32
   |
85 |         Tracks::<T, I>::insert(id.clone(), track.clone());
   |                                ^^^^^^^^^^ help: try dereferencing it: `*id`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
   = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 20 in pallets/referenda-tracks/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

duplicated attribute

warning: duplicated attribute
  --> pallets/referenda-tracks/src/benchmarking.rs:20:8
   |
20 | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first defined here
  --> pallets/referenda-tracks/src/lib.rs:37:7
   |
37 | #[cfg(feature = "runtime-benchmarks")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove this attribute
  --> pallets/referenda-tracks/src/benchmarking.rs:20:8
   |
20 | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
   = note: `#[warn(clippy::duplicated_attributes)]` on by default

Check warning on line 320 in pallets/pass/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `pallet::Event<T, I>`

warning: useless conversion to the same type: `pallet::Event<T, I>`
   --> pallets/pass/src/lib.rs:316:13
    |
316 | /             Event::<T, I>::SessionCreated {
317 | |                 session_key: session_key.clone(),
318 | |                 until,
319 | |             }
320 | |             .into(),
    | |___________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
help: consider removing `.into()`
    |
316 ~             Event::<T, I>::SessionCreated {
317 +                 session_key: session_key.clone(),
318 +                 until,
319 ~             },
    |

Check warning on line 262 in pallets/pass/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `[u8; 32]` which implements the `Copy` trait

warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait
   --> pallets/pass/src/lib.rs:262:28
    |
262 |                 device_id: device_id.clone(),
    |                            ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*device_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 264 in pallets/pass/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `pallet::Event<T, I>`

warning: useless conversion to the same type: `pallet::Event<T, I>`
   --> pallets/pass/src/lib.rs:260:13
    |
260 | /             Event::<T, I>::AddedDevice {
261 | |                 who: who.clone(),
262 | |                 device_id: device_id.clone(),
263 | |             }
264 | |             .into(),
    | |___________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `#[warn(clippy::useless_conversion)]` on by default
help: consider removing `.into()`
    |
260 ~             Event::<T, I>::AddedDevice {
261 +                 who: who.clone(),
262 +                 device_id: device_id.clone(),
263 ~             },
    |

Check warning on line 80 in pallets/pass/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
  --> pallets/pass/src/lib.rs:80:15
   |
80 |     #[pallet::pallet]
   |               ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
   = note: `#[warn(clippy::manual_inspect)]` on by default
help: try
   |
80 -     #[pallet::pallet]
80 +     #[pallet::&inspect_err]
   |

Check warning on line 166 in pallets/pass/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> pallets/pass/src/lib.rs:166:60
    |
166 |             let device = Devices::<T, I>::get(&account_id, &device_id)
    |                                                            ^^^^^^^^^^ help: change this to: `device_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 44 in pallets/pass/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref on an immutable reference

warning: deref on an immutable reference
  --> pallets/pass/src/benchmarking.rs:44:33
   |
44 |         let user_id = hash::<T>(&*b"my-account");
   |                                 ^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `b"my-account"`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
   = note: `#[warn(clippy::borrow_deref_ref)]` on by default

Check warning on line 1 in pallets/pass/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

duplicated attribute

warning: duplicated attribute
  --> pallets/pass/src/benchmarking.rs:1:8
   |
1  | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first defined here
  --> pallets/pass/src/lib.rs:26:7
   |
26 | #[cfg(feature = "runtime-benchmarks")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove this attribute
  --> pallets/pass/src/benchmarking.rs:1:8
   |
1  | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
   = note: `#[warn(clippy::duplicated_attributes)]` on by default

Check warning on line 1 in pallets/template/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

duplicated attribute

warning: duplicated attribute
  --> pallets/template/src/benchmarking.rs:1:8
   |
1  | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first defined here
  --> pallets/template/src/lib.rs:10:7
   |
10 | #[cfg(feature = "runtime-benchmarks")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove this attribute
  --> pallets/template/src/benchmarking.rs:1:8
   |
1  | #![cfg(feature = "runtime-benchmarks")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
   = note: `#[warn(clippy::duplicated_attributes)]` on by default

Check warning on line 36 in pallets/pass/src/benchmarking.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

bound is defined in more than one place

warning: bound is defined in more than one place
  --> pallets/pass/src/benchmarking.rs:30:1
   |
30 | / #[instance_benchmarks(
31 | | where
32 | |     T: frame_system::Config + crate::Config<I>,
   | |     ^
33 | |     OriginFor<T>: From<frame_system::Origin<T>>,
34 | |     T::Hash: Into<HashedUserId>,
35 | |     RuntimeEventFor<T, I>: From<frame_system::Event<T>>,
36 | | )]
   | |__^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
   = note: `#[warn(clippy::multiple_bound_locations)]` on by default
   = note: this warning originates in the attribute macro `instance_benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 32 in pallets/gas-transaction-payment/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
  --> pallets/gas-transaction-payment/src/lib.rs:32:15
   |
32 |     #[pallet::pallet]
   |               ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
   = note: `#[warn(clippy::manual_inspect)]` on by default
help: try
   |
32 -     #[pallet::pallet]
32 +     #[pallet::&inspect_err]
   |

Check warning on line 120 in pallets/gas-transaction-payment/src/extensions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `DispatchInfo` which implements the `Copy` trait

warning: using `clone` on type `DispatchInfo` which implements the `Copy` trait
   --> pallets/gas-transaction-payment/src/extensions.rs:120:22
    |
120 |                     &info.clone().into(),
    |                      ^^^^^^^^^^^^ help: try dereferencing it: `(*info)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 120 in pallets/gas-transaction-payment/src/extensions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::DispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::DispatchInfo`
   --> pallets/gas-transaction-payment/src/extensions.rs:120:22
    |
120 |                     &info.clone().into(),
    |                      ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `info.clone()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 102 in pallets/gas-transaction-payment/src/extensions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant pattern matching, consider using `is_some()`

warning: redundant pattern matching, consider using `is_some()`
   --> pallets/gas-transaction-payment/src/extensions.rs:102:16
    |
102 |         if let Some(_) = T::GasBurner::check_available_gas(who, &info.weight) {
    |         -------^^^^^^^------------------------------------------------------- help: try: `if T::GasBurner::check_available_gas(who, &info.weight).is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

Check warning on line 98 in traits/memberships/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`self.0.saturating_sub(n.get())` is never smaller than `Self::MIN.0` and has therefore no effect

warning: `self.0.saturating_sub(n.get())` is never smaller than `Self::MIN.0` and has therefore no effect
  --> traits/memberships/src/lib.rs:98:14
   |
98 |         Self(self.0.saturating_sub(n.get()).max(Self::MIN.0))
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.0.saturating_sub(n.get())`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_min_or_max
   = note: `#[warn(clippy::unnecessary_min_or_max)]` on by default