Skip to content

Deferred calls

Deferred calls #8213

GitHub Actions / clippy failed Aug 26, 2024 in 0s

clippy

10 errors

Details

Results

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

Versions

  • rustc 1.74.1 (a28077b28 2023-12-04)
  • cargo 1.74.1 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (a28077b 2023-12-04)

Annotations

Check failure on line 234 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
   --> massa-models/src/deferred_calls.rs:231:17
    |
231 | /                 return Err(ModelsError::InvalidVersionError(format!(
232 | |                     "Invalid version to create an DeferredCallId: {}",
233 | |                     version
234 | |                 )))
    | |___________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `-D clippy::needless-return` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
    |
231 ~                 Err(ModelsError::InvalidVersionError(format!(
232 +                     "Invalid version to create an DeferredCallId: {}",
233 +                     version
234 +                 )))
    |

Check failure on line 131 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler
   --> massa-models/src/deferred_calls.rs:131:40
    |
131 |             serializer.serialize_bytes(&self.as_bytes())
    |                                        ^^^^^^^^^^^^^^^^ help: change this to: `self.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 75 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `DeferredCallIdDeserializer`

error: you should consider adding a `Default` implementation for `DeferredCallIdDeserializer`
  --> massa-models/src/deferred_calls.rs:68:5
   |
68 | /     pub fn new() -> Self {
69 | |         Self {
70 | |             bytes_deserializer: VecU8Deserializer::new(
71 | |                 std::ops::Bound::Included(0),
...  |
74 | |         }
75 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `-D clippy::new-without-default` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::new_without_default)]`
help: try adding this
   |
66 + impl Default for DeferredCallIdDeserializer {
67 +     fn default() -> Self {
68 +         Self::new()
69 +     }
70 + }
   |

Check failure on line 234 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
   --> massa-models/src/deferred_calls.rs:231:17
    |
231 | /                 return Err(ModelsError::InvalidVersionError(format!(
232 | |                     "Invalid version to create an DeferredCallId: {}",
233 | |                     version
234 | |                 )))
    | |___________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `-D clippy::needless-return` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
    |
231 ~                 Err(ModelsError::InvalidVersionError(format!(
232 +                     "Invalid version to create an DeferredCallId: {}",
233 +                     version
234 +                 )))
    |

Check failure on line 131 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler
   --> massa-models/src/deferred_calls.rs:131:40
    |
131 |             serializer.serialize_bytes(&self.as_bytes())
    |                                        ^^^^^^^^^^^^^^^^ help: change this to: `self.as_bytes()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 75 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `DeferredCallIdDeserializer`

error: you should consider adding a `Default` implementation for `DeferredCallIdDeserializer`
  --> massa-models/src/deferred_calls.rs:68:5
   |
68 | /     pub fn new() -> Self {
69 | |         Self {
70 | |             bytes_deserializer: VecU8Deserializer::new(
71 | |                 std::ops::Bound::Included(0),
...  |
74 | |         }
75 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `-D clippy::new-without-default` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::new_without_default)]`
help: try adding this
   |
66 + impl Default for DeferredCallIdDeserializer {
67 +     fn default() -> Self {
68 +         Self::new()
69 +     }
70 + }
   |

Check failure on line 28 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused macro definition: `DeferredCallIdVariant`

error: unused macro definition: `DeferredCallIdVariant`
  --> massa-models/src/deferred_calls.rs:28:12
   |
28 | pub struct DeferredCallId(Vec<u8>);
   |            ^^^^^^^^^^^^^^

Check failure on line 28 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused macro definition: `DeferredCallId`

error: unused macro definition: `DeferredCallId`
  --> massa-models/src/deferred_calls.rs:28:12
   |
28 | pub struct DeferredCallId(Vec<u8>);
   |            ^^^^^^^^^^^^^^
   |
   = note: `-D unused-macros` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_macros)]`

Check failure on line 28 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused macro definition: `DeferredCallIdVariant`

error: unused macro definition: `DeferredCallIdVariant`
  --> massa-models/src/deferred_calls.rs:28:12
   |
28 | pub struct DeferredCallId(Vec<u8>);
   |            ^^^^^^^^^^^^^^

Check failure on line 28 in massa-models/src/deferred_calls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused macro definition: `DeferredCallId`

error: unused macro definition: `DeferredCallId`
  --> massa-models/src/deferred_calls.rs:28:12
   |
28 | pub struct DeferredCallId(Vec<u8>);
   |            ^^^^^^^^^^^^^^
   |
   = note: `-D unused-macros` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_macros)]`