Skip to content

Commit

Permalink
chore: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Oct 4, 2024
1 parent 1af0e3c commit ae9365e
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion crates/iota-rust-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ mod _serde {
#[cfg(feature = "schemars")]
mod _schemars {
use schemars::{
schema::{InstanceType, Metadata, SchemaObject},
JsonSchema,
schema::{InstanceType, Metadata, SchemaObject},
};

pub(crate) struct U64;
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-rust-sdk/src/types/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ mod serialization {
where
S: Serializer,
{
let mut seq = serializer.serialize_seq(Some(self.0 .0.len()))?;
for txn in &self.0 .0 {
let mut seq = serializer.serialize_seq(Some(self.0.0.len()))?;
for txn in &self.0.0 {
let digests = Digests {
transaction: &txn.transaction,
effects: &txn.effects,
Expand All @@ -404,8 +404,8 @@ mod serialization {
where
S: Serializer,
{
let mut seq = serializer.serialize_seq(Some(self.0 .0.len()))?;
for txn in &self.0 .0 {
let mut seq = serializer.serialize_seq(Some(self.0.0.len()))?;
for txn in &self.0.0 {
seq.serialize_element(&txn.signatures)?;
}
seq.end()
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-rust-sdk/src/types/crypto/multisig.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{
zklogin::{ZkLoginAuthenticator, ZkLoginPublicIdentifier},
Ed25519PublicKey, Ed25519Signature, Secp256k1PublicKey, Secp256k1Signature, Secp256r1PublicKey,
Secp256r1Signature, SignatureScheme,
zklogin::{ZkLoginAuthenticator, ZkLoginPublicIdentifier},
};

pub type WeightUnit = u8;
Expand Down Expand Up @@ -166,8 +166,8 @@ mod serialization {

use super::*;
use crate::types::{
crypto::{Base64Array33, Base64Array34},
Ed25519PublicKey, Secp256k1PublicKey, Secp256r1PublicKey, SignatureScheme,
crypto::{Base64Array33, Base64Array34},
};

pub struct Base64MultisigMemberPublicKey;
Expand Down
6 changes: 1 addition & 5 deletions crates/iota-rust-sdk/src/types/crypto/zklogin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@ impl Bn254FieldElement {
}

// If the value is '0' then just return a slice of length 1 of the final byte
if buf.is_empty() {
&self.0[31..]
} else {
buf
}
if buf.is_empty() { &self.0[31..] } else { buf }
}

pub fn padded(&self) -> &[u8] {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rust-sdk/src/types/effects/v1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::types::{
EpochId, GasCostSummary, ObjectId, ObjectReference, TransactionDigest, TransactionEventsDigest,
execution_status::ExecutionStatus,
object::{Owner, Version},
EpochId, GasCostSummary, ObjectId, ObjectReference, TransactionDigest, TransactionEventsDigest,
};

/// The response from processing a transaction or a certified transaction
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rust-sdk/src/types/effects/v2.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::types::{
EpochId, GasCostSummary, ObjectDigest, ObjectId, TransactionDigest, TransactionEventsDigest,
digest::EffectsAuxiliaryDataDigest,
execution_status::ExecutionStatus,
object::{Owner, Version},
EpochId, GasCostSummary, ObjectDigest, ObjectId, TransactionDigest, TransactionEventsDigest,
};

/// The response from processing a transaction or a certified transaction
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-rust-sdk/src/types/transaction/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::types::{ObjectId, ObjectReference};
mod transaction {
use super::*;
use crate::types::{
transaction::{GasPayment, Transaction, TransactionExpiration, TransactionKind},
Address,
transaction::{GasPayment, Transaction, TransactionExpiration, TransactionKind},
};

#[derive(serde_derive::Serialize)]
Expand Down Expand Up @@ -321,8 +321,8 @@ mod transaction_kind {
mod end_of_epoch {
use super::*;
use crate::types::{
transaction::{AuthenticatorStateExpire, ChangeEpoch, EndOfEpochTransactionKind},
CheckpointDigest,
transaction::{AuthenticatorStateExpire, ChangeEpoch, EndOfEpochTransactionKind},
};

#[derive(serde_derive::Serialize)]
Expand Down Expand Up @@ -967,8 +967,8 @@ mod signed_transaction {

use super::*;
use crate::types::{
transaction::{SignedTransaction, Transaction},
UserSignature,
transaction::{SignedTransaction, Transaction},
};

/// Intents are defined as:
Expand Down Expand Up @@ -1235,8 +1235,8 @@ mod test {
use wasm_bindgen_test::wasm_bindgen_test as test;

use crate::types::{
transaction::{Argument, InputArgument, Transaction},
ObjectDigest, ObjectId, ObjectReference,
transaction::{Argument, InputArgument, Transaction},
};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rust-sdk/src/types/transaction/unresolved.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{Command, TransactionExpiration};
use crate::types::{object::Version, Address, ObjectDigest, ObjectId};
use crate::types::{Address, ObjectDigest, ObjectId, object::Version};

// A potentially Unresolved user transaction
#[cfg_attr(
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-rust-sdk/src/types/type_tag/parse.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use winnow::{
PResult, Parser,
ascii::space0,
combinator::{alt, delimited, eof, opt, separated},
stream::AsChar,
token::{one_of, take_while},
PResult, Parser,
};

use super::{Address, Identifier, StructTag, TypeTag};
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-rust-sdk/src/types/type_tag/serialization.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use serde::{de::Visitor, Deserialize, Deserializer, Serialize, Serializer};
use serde::{Deserialize, Deserializer, Serialize, Serializer, de::Visitor};
use serde_with::{DeserializeAs, SerializeAs};

use super::*;
Expand Down Expand Up @@ -243,8 +243,8 @@ impl<'de> Deserialize<'de> for StructTag {
#[cfg(feature = "schemars")]
mod json_schema {
use schemars::{
schema::{InstanceType, Metadata, SchemaObject, StringValidation},
JsonSchema,
schema::{InstanceType, Metadata, SchemaObject, StringValidation},
};

use super::*;
Expand Down
9 changes: 9 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
edition = "2021"
style_edition = "2024"
format_code_in_doc_comments = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
normalize_comments = true
normalize_doc_attributes = true
wrap_comments = true
ignore = ["external-crates"]

0 comments on commit ae9365e

Please sign in to comment.