Skip to content

rename features in github workflow #164

rename features in github workflow

rename features in github workflow #164

GitHub Actions / clippy succeeded Jul 19, 2024 in 0s

clippy

26 warnings

Details

Results

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

Versions

  • rustc 1.81.0-nightly (5affbb171 2024-07-18)
  • cargo 1.81.0-nightly (a2b58c3da 2024-07-16)
  • clippy 0.1.81 (5affbb1 2024-07-18)

Annotations

Check warning on line 98 in src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> src/wallet/mod.rs:87:1
   |
87 | / impl ToString for Wallet {
88 | |     /// Returns a string representation of a Wallet.
89 | |     fn to_string(&self) -> String {
90 | |         let string_list = [
...  |
97 | |     }
98 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 212 in src/models/requests/ledger_entry.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

warning: the `Err`-variant returned from this function is very large
   --> src/models/requests/ledger_entry.rs:212:35
    |
212 |       fn _get_field_error(&self) -> Result<(), XRPLLedgerEntryException>;
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: src/models/requests/exceptions.rs:43:5
    |
43  | /     DefineExactlyOneOf {
44  | |         field1: Cow<'a, str>,
45  | |         field2: Cow<'a, str>,
46  | |         field3: Cow<'a, str>,
...   |
54  | |         resource: Cow<'a, str>,
55  | |     },
    | |_____- the largest variant contains at least 264 bytes
    |
    = help: try reducing the size of `models::requests::exceptions::XRPLLedgerEntryException<'_>`, for example by boxing large elements or replacing it with `Box<models::requests::exceptions::XRPLLedgerEntryException<'_>>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
    = note: `#[warn(clippy::result_large_err)]` on by default

Check warning on line 100 in src/models/ledger/objects/signer_list.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (9/7)

warning: this function has too many arguments (9/7)
   --> src/models/ledger/objects/signer_list.rs:90:5
    |
90  | /     pub fn new(
91  | |         flags: FlagCollection<SignerListFlag>,
92  | |         index: Option<Cow<'a, str>>,
93  | |         ledger_index: Option<Cow<'a, str>>,
...   |
99  | |         signer_quorum: u32,
100 | |     ) -> Self {
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 116 in src/models/ledger/objects/ripple_state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (14/7)

warning: this function has too many arguments (14/7)
   --> src/models/ledger/objects/ripple_state.rs:101:5
    |
101 | /     pub fn new(
102 | |         flags: FlagCollection<RippleStateFlag>,
103 | |         index: Option<Cow<'a, str>>,
104 | |         ledger_index: Option<Cow<'a, str>>,
...   |
115 | |         low_quality_out: Option<u32>,
116 | |     ) -> Self {
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 99 in src/models/ledger/objects/pay_channel.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (16/7)

warning: this function has too many arguments (16/7)
  --> src/models/ledger/objects/pay_channel.rs:82:5
   |
82 | /     pub fn new(
83 | |         index: Option<Cow<'a, str>>,
84 | |         ledger_index: Option<Cow<'a, str>>,
85 | |         account: Cow<'a, str>,
...  |
98 | |         source_tag: Option<u32>,
99 | |     ) -> Self {
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 95 in src/models/ledger/objects/offer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (13/7)

warning: this function has too many arguments (13/7)
  --> src/models/ledger/objects/offer.rs:81:5
   |
81 | /     pub fn new(
82 | |         flags: FlagCollection<OfferFlag>,
83 | |         index: Option<Cow<'a, str>>,
84 | |         ledger_index: Option<Cow<'a, str>>,
...  |
94 | |         expiration: Option<u32>,
95 | |     ) -> Self {
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 96 in src/models/ledger/objects/nftoken_offer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (12/7)

warning: this function has too many arguments (12/7)
  --> src/models/ledger/objects/nftoken_offer.rs:83:5
   |
83 | /     pub fn new(
84 | |         flags: FlagCollection<NFTokenOfferFlag>,
85 | |         index: Option<Cow<'a, str>>,
86 | |         ledger_index: Option<Cow<'a, str>>,
...  |
95 | |         owner_node: Option<Cow<'a, str>>,
96 | |     ) -> Self {
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 104 in src/models/ledger/objects/escrow.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (14/7)

warning: this function has too many arguments (14/7)
   --> src/models/ledger/objects/escrow.rs:89:5
    |
89  | /     pub fn new(
90  | |         index: Option<Cow<'a, str>>,
91  | |         ledger_index: Option<Cow<'a, str>>,
92  | |         account: Cow<'a, str>,
...   |
103 | |         source_tag: Option<u32>,
104 | |     ) -> Self {
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 89 in src/models/ledger/objects/directory_node.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (12/7)

warning: this function has too many arguments (12/7)
  --> src/models/ledger/objects/directory_node.rs:76:5
   |
76 | /     pub fn new(
77 | |         index: Option<Cow<'a, str>>,
78 | |         ledger_index: Option<Cow<'a, str>>,
79 | |         indexes: Vec<Cow<'a, str>>,
...  |
88 | |         taker_pays_issuer: Option<Cow<'a, str>>,
89 | |     ) -> Self {
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 89 in src/models/ledger/objects/check.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (14/7)

warning: this function has too many arguments (14/7)
  --> src/models/ledger/objects/check.rs:74:5
   |
74 | /     pub fn new(
75 | |         index: Option<Cow<'a, str>>,
76 | |         ledger_index: Option<Cow<'a, str>>,
77 | |         account: Cow<'a, str>,
...  |
88 | |         source_tag: Option<u32>,
89 | |     ) -> Self {
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 112 in src/models/ledger/objects/amm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (9/7)

warning: this function has too many arguments (9/7)
   --> src/models/ledger/objects/amm.rs:102:5
    |
102 | /     pub fn new(
103 | |         index: Option<Cow<'a, str>>,
104 | |         ledger_index: Option<Cow<'a, str>>,
105 | |         amm_account: Cow<'a, str>,
...   |
111 | |         vote_slots: Option<Vec<VoteEntry>>,
112 | |     ) -> Self {
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 154 in src/models/ledger/objects/account_root.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (22/7)

warning: this function has too many arguments (22/7)
   --> src/models/ledger/objects/account_root.rs:131:5
    |
131 | /     pub fn new(
132 | |         flags: FlagCollection<AccountRootFlag>,
133 | |         index: Option<Cow<'a, str>>,
134 | |         ledger_index: Option<Cow<'a, str>>,
...   |
153 | |         wallet_size: Option<u32>,
154 | |     ) -> Self {
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
    = note: `#[warn(clippy::too_many_arguments)]` on by default

Check warning on line 34 in src/models/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
  --> src/models/exceptions.rs:34:6
   |
34 | impl<'a> alloc::error::Error for XRPLFlagsException {}
   |      ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
   = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default

Check warning on line 104 in src/core/types/vector256.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/vector256.rs:99:1
    |
99  | / impl ToString for Vector256 {
100 | |     /// Get the hex representation of the Vector256 bytes.
101 | |     fn to_string(&self) -> String {
102 | |         hex::encode_upper(self.as_ref())
103 | |     }
104 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 302 in src/core/types/hash.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/hash.rs:297:1
    |
297 | / impl ToString for Hash256 {
298 | |     /// Get the hex representation of the Hash256 bytes.
299 | |     fn to_string(&self) -> String {
300 | |         hex::encode_upper(self.as_ref())
301 | |     }
302 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 295 in src/core/types/hash.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/hash.rs:290:1
    |
290 | / impl ToString for Hash160 {
291 | |     /// Get the hex representation of the Hash160 bytes.
292 | |     fn to_string(&self) -> String {
293 | |         hex::encode_upper(self.as_ref())
294 | |     }
295 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 288 in src/core/types/hash.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/hash.rs:283:1
    |
283 | / impl ToString for Hash128 {
284 | |     /// Get the hex representation of the Hash128 bytes.
285 | |     fn to_string(&self) -> String {
286 | |         hex::encode_upper(self.as_ref())
287 | |     }
288 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 135 in src/core/types/currency.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/currency.rs:118:1
    |
118 | / impl ToString for Currency {
119 | |     /// Get the ISO or hex representation of the Currency bytes.
120 | |     fn to_string(&self) -> String {
121 | |         let buffer = self.0.as_ref();
...   |
134 | |     }
135 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 59 in src/core/types/blob.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> src/core/types/blob.rs:54:1
   |
54 | / impl ToString for Blob {
55 | |     /// Get the hex representation of the Blob bytes.
56 | |     fn to_string(&self) -> String {
57 | |         hex::encode_upper(self.as_ref())
58 | |     }
59 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 351 in src/core/types/amount.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/types/amount.rs:346:1
    |
346 | / impl ToString for Amount {
347 | |     /// Get the hex representation of the Amount bytes.
348 | |     fn to_string(&self) -> String {
349 | |         hex::encode_upper(self.as_ref())
350 | |     }
351 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 94 in src/core/types/account_id.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> src/core/types/account_id.rs:89:1
   |
89 | / impl ToString for AccountId {
90 | |     /// Get the classic address of the AccountId bytes.
91 | |     fn to_string(&self) -> String {
92 | |         encode_classic_address(self.as_ref()).expect("to_string")
93 | |     }
94 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 140 in src/core/definitions/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> src/core/definitions/mod.rs:135:1
    |
135 | / impl ToString for FieldHeader {
136 | |     /// Convert the FieldHeader to a String.
137 | |     fn to_string(&self) -> String {
138 | |         format!("{}_{}", self.type_code, self.field_code)
139 | |     }
140 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
    = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 204 in src/core/addresscodec/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

warning: usage of a legacy numeric method
   --> src/core/addresscodec/mod.rs:204:48
    |
204 |     } else if tag.is_some() && tag > Some(u32::max_value().into()) {
    |                                                ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
    |
204 |     } else if tag.is_some() && tag > Some(u32::MAX.into()) {
    |                                                ~~~

Check warning on line 171 in src/asynch/clients/json_rpc/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
   --> src/asynch/clients/json_rpc/mod.rs:171:13
    |
152 | /             let response = match client.request(Method::POST, self.url.as_str()).await {
153 | |                 Ok(client) => {
154 | |                     if let Err(_error) = client
155 | |                         .body(request_buf)
...   |
168 | |                 Err(_error) => Err!(XRPLJsonRpcException::ReqwlessError),
169 | |             };
    | |______________- unnecessary `let` binding
170 |
171 |               response
    |               ^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
152 ~             
153 |
154 ~             match client.request(Method::POST, self.url.as_str()).await {
155 +                 Ok(client) => {
156 +                     if let Err(_error) = client
157 +                         .body(request_buf)
158 +                         .content_type(ContentType::TextPlain)
159 +                         .send(&mut rx_buffer)
160 +                         .await
161 +                     {
162 +                         Err!(XRPLJsonRpcException::ReqwlessError)
163 +                     } else {
164 +                         match serde_json::from_slice::<XRPLResponse<'_>>(&rx_buffer) {
165 +                             Ok(response) => Ok(response),
166 +                             Err(error) => Err!(error),
167 +                         }
168 +                     }
169 +                 }
170 +                 Err(_error) => Err!(XRPLJsonRpcException::ReqwlessError),
171 +             }
    |

Check warning on line 18 in src/asynch/clients/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `websocket_base::MessageHandler`

warning: unused import: `websocket_base::MessageHandler`
  --> src/asynch/clients/websocket/mod.rs:18:5
   |
18 | use websocket_base::MessageHandler;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^