Skip to content

Commit 9bceea4

Browse files
committed
fixing clippy stuff
1 parent 2ed33c5 commit 9bceea4

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

src/cis2/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ impl Cis2Contract {
215215
/// update transaction.
216216
/// * `transaction_metadata` - Metadata for constructing the transaction.
217217
/// * `transfers` - A list of CIS2 token transfers to execute.
218+
#[allow(clippy::result_large_err)]
218219
pub fn make_transfer(
219220
&self,
220221
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -241,6 +242,7 @@ impl Cis2Contract {
241242

242243
/// Like [`make_transfer`](Self::make_transfer), except it is more ergonomic
243244
/// when transferring a single token.
245+
#[allow(clippy::result_large_err)]
244246
pub fn make_transfer_single(
245247
&self,
246248
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -307,6 +309,7 @@ impl Cis2Contract {
307309
/// update transaction.
308310
/// * `transaction_metadata` - Metadata for constructing the transaction.
309311
/// * `updates` - A list of CIS2 UpdateOperators to update.
312+
#[allow(clippy::result_large_err)]
310313
pub fn make_update_operator(
311314
&self,
312315
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -360,6 +363,7 @@ impl Cis2Contract {
360363

361364
/// Like [`make_update_operator`](Self::make_update_operator), but more
362365
/// ergonomic when updating a single operator.
366+
#[allow(clippy::result_large_err)]
363367
pub fn make_update_operator_single(
364368
&self,
365369
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -489,6 +493,7 @@ impl Cis2Contract {
489493

490494
/// Extract an element from the given vector if the vector has exactly one
491495
/// element. Otherwise raise a parse error.
496+
#[allow(clippy::result_large_err)]
492497
fn only_one<A, V: AsRef<Vec<A>>>(res: V) -> Result<A, Cis2QueryError>
493498
where
494499
Vec<A>: From<V>,

src/cis3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ impl Cis3Contract {
189189
/// * `params` - The parameters for the permit invocation. Includes the
190190
/// signature of the sponsoree, the address of the sponsoree, and the
191191
/// signed message.
192+
#[allow(clippy::result_large_err)]
192193
pub fn make_permit(
193194
&mut self,
194195
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -237,6 +238,7 @@ impl Cis3Contract {
237238

238239
/// Extract an element from the given vector if the vector has exactly one
239240
/// element. Otherwise raise a parse error.
241+
#[allow(clippy::result_large_err)]
240242
fn only_one<A, V: AsRef<Vec<A>>>(res: V) -> Result<A, Cis3SupportsPermitError>
241243
where
242244
Vec<A>: From<V>,

src/cis4.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ impl Cis4Contract {
157157

158158
/// Construct a transaction for registering a new credential.
159159
/// Note that this **does not** send the transaction.c
160+
#[allow(clippy::result_large_err)]
160161
pub fn make_register_credential(
161162
&self,
162163
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -244,6 +245,7 @@ impl Cis4Contract {
244245
/// The extra nonce that must be provided is the holder's nonce inside the
245246
/// contract. The signature on this revocation message is set to expire at
246247
/// the same time as the transaction.
248+
#[allow(clippy::result_large_err)]
247249
pub fn make_revoke_credential_as_holder(
248250
&self,
249251
signer: &impl transactions::ExactSizeTransactionSigner,
@@ -310,6 +312,7 @@ impl Cis4Contract {
310312
/// key that signs the revocation message.
311313
/// The signature on this revocation message is set to expire at
312314
/// the same time as the transaction.
315+
#[allow(clippy::result_large_err)]
313316
pub fn make_revoke_credential_other(
314317
&self,
315318
signer: &impl transactions::ExactSizeTransactionSigner,

src/protocol_level_tokens/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl TryFrom<generated::plt::TokenId> for TokenId {
2323

2424
fn try_from(token_id: generated::plt::TokenId) -> Result<Self, Self::Error> {
2525
Self::try_from(token_id.value)
26-
.map_err(|err| tonic::Status::internal(format!("Unexpected token identifier: {}", err)))
26+
.map_err(|err| tonic::Status::internal(format!("Unexpected token identifier: {err}")))
2727
}
2828
}
2929

src/v2/conversions.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ fn consume<A: Deserial>(bytes: &[u8]) -> Result<A, tonic::Status> {
3737
match res {
3838
Ok(v) if cursor.position() == bytes.len() as u64 => Ok(v),
3939
Err(e) => Err(tonic::Status::internal(format!(
40-
"Could not deserialize response: {}",
41-
e
40+
"Could not deserialize response: {e}"
4241
))),
4342
Ok(_) => Err(tonic::Status::internal(
4443
"Could not deserialize response: trailing bytes",
@@ -48,6 +47,7 @@ fn consume<A: Deserial>(bytes: &[u8]) -> Result<A, tonic::Status> {
4847

4948
/// Convert from the 0-based protobuf representation to the 1-based internal
5049
/// representation of a [ProtocolVersionInt].
50+
#[allow(clippy::result_large_err)]
5151
fn protocol_version_int_from_enum(tag_number: i32) -> Result<ProtocolVersionInt, tonic::Status> {
5252
if tag_number < 0 {
5353
Err(tonic::Status::internal(format!(
@@ -2273,7 +2273,7 @@ impl TryFrom<baker_event::Event> for super::types::BakerEvent {
22732273
baker_event::Event::BakerSetMetadataUrl(v) => Self::BakerSetMetadataURL {
22742274
baker_id: v.baker_id.require()?.into(),
22752275
metadata_url: v.url.try_into().map_err(|e| {
2276-
tonic::Status::invalid_argument(format!("Invalid argument: {}", e))
2276+
tonic::Status::invalid_argument(format!("Invalid argument: {e}"))
22772277
})?,
22782278
},
22792279
baker_event::Event::BakerSetTransactionFeeCommission(v) => {
@@ -2317,7 +2317,7 @@ impl TryFrom<RegisteredData> for super::types::RegisteredData {
23172317
value
23182318
.value
23192319
.try_into()
2320-
.map_err(|e| tonic::Status::invalid_argument(format!("{}", e)))
2320+
.map_err(|e| tonic::Status::invalid_argument(format!("{e}")))
23212321
}
23222322
}
23232323

@@ -3443,6 +3443,7 @@ impl TryFrom<block_special_event::AccountAmounts>
34433443
{
34443444
type Error = tonic::Status;
34453445

3446+
#[allow(clippy::result_large_err)]
34463447
fn try_from(message: block_special_event::AccountAmounts) -> Result<Self, Self::Error> {
34473448
fn mapper(
34483449
entry: block_special_event::account_amounts::Entry,

src/v2/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,6 +3010,7 @@ impl FinalizedBlocksStream {
30103010
}
30113011
}
30123012

3013+
#[allow(clippy::result_large_err)]
30133014
fn extract_metadata<T>(response: &tonic::Response<T>) -> endpoints::RPCResult<BlockHash> {
30143015
match response.metadata().get("blockhash") {
30153016
Some(bytes) => {

0 commit comments

Comments
 (0)