Skip to content

Commit 91ff509

Browse files
committed
chore: fix clippy lints
1 parent 0c383a1 commit 91ff509

File tree

14 files changed

+24
-26
lines changed

14 files changed

+24
-26
lines changed

crates/proto-build/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn main() {
5858
.out_dir(&out_dir)
5959
.compile_fds(fds.clone())
6060
{
61-
panic!("failed to compile protos: {}", error);
61+
panic!("failed to compile protos: {error}");
6262
}
6363

6464
// Group the files by their package, in order to have a single fds file per package, and have
@@ -102,7 +102,7 @@ fn main() {
102102
.status();
103103
match status {
104104
Ok(status) if !status.success() => panic!("You should commit the protobuf files"),
105-
Err(error) => panic!("failed to run `git diff`: {}", error),
105+
Err(error) => panic!("failed to run `git diff`: {error}"),
106106
Ok(_) => {}
107107
}
108108
}

crates/sui-graphql-client/examples/custom_query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ async fn main() -> Result<()> {
5252
let response = client
5353
.run_query::<CustomQuery, CustomVariables>(&operation)
5454
.await;
55-
println!("{:?}", response);
55+
println!("{response:?}");
5656

5757
// Query the data for epoch 1.
5858
let epoch_id = 1;
5959
let operation = CustomQuery::build(CustomVariables { id: Some(epoch_id) });
6060
let response = client
6161
.run_query::<CustomQuery, CustomVariables>(&operation)
6262
.await;
63-
println!("{:?}", response);
63+
println!("{response:?}");
6464

6565
// When the query has no variables, just pass () as the type argument
6666
let operation = ChainIdQuery::build(());

crates/sui-graphql-client/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl std::fmt::Display for Error {
112112
write!(f, "{}", self.inner.kind)?;
113113

114114
if let Some(source) = &self.inner.source {
115-
writeln!(f, " {}", source)?;
115+
writeln!(f, " {source}")?;
116116
}
117117
Ok(())
118118
}

crates/sui-graphql-client/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ impl DynamicFieldOutput {
263263
assert_eq!(
264264
Some(&expected_type),
265265
typetag.as_ref(),
266-
"Expected type {}, but got {:?}",
267-
expected_type,
268-
typetag
266+
"Expected type {expected_type}, but got {typetag:?}"
269267
);
270268

271269
if let Some((_, bcs)) = &self.value {

crates/sui-graphql-client/src/query_types/checkpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl TryInto<CheckpointSummary> for Checkpoint {
9393
bcs::from_bytes::<CheckpointSummary>(&bcs).map_err(|e| {
9494
Error::from_error(
9595
Kind::Other,
96-
format!("Failed to deserialize checkpoint summary: {}", e),
96+
format!("Failed to deserialize checkpoint summary: {e}"),
9797
)
9898
})
9999
})

crates/sui-rpc/src/proto/sui/rpc/v2beta2/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::uninlined_format_args)]
2+
13
// Include the generated proto definitions
24
include!("../../../generated/sui.rpc.v2beta2.rs");
35

crates/sui-sdk-types/src/address.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl std::fmt::Display for Address {
184184
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
185185
write!(f, "0x")?;
186186
for byte in &self.0 {
187-
write!(f, "{:02x}", byte)?;
187+
write!(f, "{byte:02x}")?;
188188
}
189189

190190
Ok(())
@@ -194,7 +194,7 @@ impl std::fmt::Display for Address {
194194
impl std::fmt::Debug for Address {
195195
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
196196
f.debug_tuple("Address")
197-
.field(&format_args!("\"{}\"", self))
197+
.field(&format_args!("\"{self}\""))
198198
.finish()
199199
}
200200
}

crates/sui-sdk-types/src/crypto/bls12381.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl std::fmt::Display for Bls12381PublicKey {
107107
impl std::fmt::Debug for Bls12381PublicKey {
108108
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
109109
f.debug_tuple("Bls12381PublicKey")
110-
.field(&format_args!("\"{}\"", self))
110+
.field(&format_args!("\"{self}\""))
111111
.finish()
112112
}
113113
}
@@ -215,7 +215,7 @@ impl std::fmt::Display for Bls12381Signature {
215215
impl std::fmt::Debug for Bls12381Signature {
216216
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
217217
f.debug_tuple("Bls12381Signature")
218-
.field(&format_args!("\"{}\"", self))
218+
.field(&format_args!("\"{self}\""))
219219
.finish()
220220
}
221221
}

crates/sui-sdk-types/src/crypto/ed25519.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl std::fmt::Display for Ed25519PublicKey {
101101
impl std::fmt::Debug for Ed25519PublicKey {
102102
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
103103
f.debug_tuple("Ed25519PublicKey")
104-
.field(&format_args!("\"{}\"", self))
104+
.field(&format_args!("\"{self}\""))
105105
.finish()
106106
}
107107
}
@@ -209,7 +209,7 @@ impl std::fmt::Display for Ed25519Signature {
209209
impl std::fmt::Debug for Ed25519Signature {
210210
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
211211
f.debug_tuple("Ed25519Signature")
212-
.field(&format_args!("\"{}\"", self))
212+
.field(&format_args!("\"{self}\""))
213213
.finish()
214214
}
215215
}

crates/sui-sdk-types/src/crypto/secp256k1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl std::fmt::Display for Secp256k1PublicKey {
103103
impl std::fmt::Debug for Secp256k1PublicKey {
104104
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
105105
f.debug_tuple("Secp256k1PublicKey")
106-
.field(&format_args!("\"{}\"", self))
106+
.field(&format_args!("\"{self}\""))
107107
.finish()
108108
}
109109
}
@@ -211,7 +211,7 @@ impl std::fmt::Display for Secp256k1Signature {
211211
impl std::fmt::Debug for Secp256k1Signature {
212212
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
213213
f.debug_tuple("Secp256k1Signature")
214-
.field(&format_args!("\"{}\"", self))
214+
.field(&format_args!("\"{self}\""))
215215
.finish()
216216
}
217217
}

0 commit comments

Comments
 (0)