Skip to content

Commit c8ca172

Browse files
committed
fix cargo doc, fmt
1 parent f8a2840 commit c8ca172

File tree

374 files changed

+1155
-1171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+1155
-1171
lines changed

bindings/core/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use packable::error::UnexpectedEOF;
5-
use serde::{ser::SerializeMap, Serialize, Serializer};
5+
use serde::{Serialize, Serializer, ser::SerializeMap};
66

77
/// Result type of the bindings core crate.
88
pub type Result<T> = std::result::Result<T, Error>;

bindings/core/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ mod response;
1212
use std::fmt::{Formatter, Result as FmtResult};
1313

1414
use derivative::Derivative;
15-
use fern_logger::{logger_init, LoggerConfig, LoggerOutputConfigBuilder};
15+
use fern_logger::{LoggerConfig, LoggerOutputConfigBuilder, logger_init};
1616
pub use iota_sdk;
1717
use iota_sdk::{
1818
client::secret::{SecretManager, SecretManagerDto},
1919
wallet::{ClientOptions, Wallet},
2020
};
2121
use serde::Deserialize;
2222

23-
#[cfg(feature = "mqtt")]
24-
pub use self::method_handler::listen_mqtt;
2523
#[cfg(not(target_family = "wasm"))]
2624
pub use self::method_handler::CallMethod;
25+
#[cfg(feature = "mqtt")]
26+
pub use self::method_handler::listen_mqtt;
2727
pub use self::{
2828
error::{Error, Result},
2929
method::{AccountMethod, ClientMethod, SecretManagerMethod, UtilsMethod, WalletMethod},

bindings/core/src/method/account.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
// Copyright 2023 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4-
#[cfg(feature = "participation")]
5-
use iota_sdk::{
6-
client::node_manager::node::Node,
7-
types::api::plugins::participation::types::{ParticipationEventId, ParticipationEventType},
8-
wallet::account::types::participation::ParticipationEventRegistrationOptions,
9-
};
104
use iota_sdk::{
5+
U256,
116
client::{
12-
api::{input_selection::BurnDto, PreparedTransactionDataDto, SignedTransactionDataDto},
7+
api::{PreparedTransactionDataDto, SignedTransactionDataDto, input_selection::BurnDto},
138
secret::GenerateAddressOptions,
149
},
1510
types::block::{
1611
address::Bech32Address,
17-
output::{dto::OutputDto, OutputId, TokenId},
12+
output::{OutputId, TokenId, dto::OutputDto},
1813
payload::transaction::TransactionId,
1914
},
2015
wallet::{
16+
SendNativeTokensParams, SendNftParams, SendParams,
2117
account::{
2218
ConsolidationParams, CreateAliasParams, CreateNativeTokenParams, FilterOptions, MintNftParams,
2319
OutputParams, OutputsToClaim, SyncOptions, TransactionOptionsDto,
2420
},
25-
SendNativeTokensParams, SendNftParams, SendParams,
2621
},
27-
U256,
22+
};
23+
#[cfg(feature = "participation")]
24+
use iota_sdk::{
25+
client::node_manager::node::Node,
26+
types::api::plugins::participation::types::{ParticipationEventId, ParticipationEventType},
27+
wallet::account::types::participation::ParticipationEventRegistrationOptions,
2828
};
2929
use serde::{Deserialize, Serialize};
3030

bindings/core/src/method/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ use iota_sdk::{
1515
secret::SecretManagerDto,
1616
},
1717
types::block::{
18+
BlockDto, BlockId,
1819
address::{Bech32Address, Hrp},
1920
output::{
21+
AliasId, FoundryId, NativeToken, NftId, OutputId,
2022
dto::{OutputDto, TokenSchemeDto},
2123
feature::dto::FeatureDto,
2224
unlock_condition::dto::UnlockConditionDto,
23-
AliasId, FoundryId, NativeToken, NftId, OutputId,
2425
},
2526
payload::{dto::PayloadDto, milestone::MilestoneId, transaction::TransactionId},
26-
BlockDto, BlockId,
2727
},
2828
};
2929
use serde::{Deserialize, Serialize};

bindings/core/src/method/utils.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ use derivative::Derivative;
55
use iota_sdk::{
66
client::secret::types::InputSigningDataDto,
77
types::block::{
8+
BlockDto,
89
address::{Bech32Address, Hrp},
9-
output::{dto::OutputDto, AliasId, NftId, OutputId, RentStructure},
10+
output::{AliasId, NftId, OutputId, RentStructure, dto::OutputDto},
1011
payload::{
1112
dto::MilestonePayloadDto,
1213
transaction::{
13-
dto::{TransactionEssenceDto, TransactionPayloadDto},
1414
TransactionId,
15+
dto::{TransactionEssenceDto, TransactionPayloadDto},
1516
},
1617
},
1718
protocol::ProtocolParameters,
1819
signature::dto::Ed25519SignatureDto,
19-
BlockDto,
2020
},
2121
};
2222
use serde::{Deserialize, Serialize};

bindings/core/src/method/wallet.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ use derivative::Derivative;
88
#[cfg(feature = "events")]
99
use iota_sdk::wallet::events::types::{WalletEvent, WalletEventType};
1010
use iota_sdk::{
11+
Url,
1112
client::{node_manager::node::NodeAuth, secret::GenerateAddressOptions},
1213
types::block::address::Hrp,
1314
wallet::{
15+
ClientOptions,
1416
account::{
15-
types::{AccountAddress, AccountIdentifier},
1617
SyncOptions,
18+
types::{AccountAddress, AccountIdentifier},
1719
},
18-
ClientOptions,
1920
},
20-
Url,
2121
};
2222
use serde::{Deserialize, Serialize};
2323

24-
use crate::method::account::AccountMethod;
2524
#[cfg(feature = "stronghold")]
2625
use crate::OmittedDebug;
26+
use crate::method::account::AccountMethod;
2727

2828
/// The methods that can be sent to the actor.
2929
#[derive(Clone, Derivative, Serialize, Deserialize)]

bindings/core/src/method_handler/account.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ use iota_sdk::{
99
PreparedTransactionData, PreparedTransactionDataDto, SignedTransactionData, SignedTransactionDataDto,
1010
},
1111
types::{
12-
block::output::{dto::OutputDto, Output},
1312
TryFromDto,
13+
block::output::{Output, dto::OutputDto},
1414
},
1515
wallet::account::{
16-
types::TransactionDto, Account, OutputDataDto, PreparedCreateNativeTokenTransactionDto, TransactionOptions,
16+
Account, OutputDataDto, PreparedCreateNativeTokenTransactionDto, TransactionOptions, types::TransactionDto,
1717
},
1818
};
1919

20-
use crate::{method::AccountMethod, Response, Result};
20+
use crate::{Response, Result, method::AccountMethod};
2121

2222
pub(crate) async fn call_account_method_internal(account: &Account, method: AccountMethod) -> Result<Response> {
2323
let response = match method {

bindings/core/src/method_handler/call_method.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ use std::pin::Pin;
55

66
use futures::Future;
77
use iota_sdk::{
8-
client::{secret::SecretManager, Client},
8+
client::{Client, secret::SecretManager},
99
wallet::Wallet,
1010
};
1111
use tokio::sync::RwLock;
1212

1313
use crate::{
14+
UtilsMethod,
1415
method::{ClientMethod, SecretManagerMethod, WalletMethod},
1516
method_handler::{
1617
client::call_client_method_internal, secret_manager::call_secret_manager_method_internal,
1718
utils::call_utils_method_internal, wallet::call_wallet_method_internal,
1819
},
1920
panic::{convert_async_panics, convert_panics},
2021
response::Response,
21-
UtilsMethod,
2222
};
2323

2424
pub trait CallMethod {

bindings/core/src/method_handler/client.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
use iota_sdk::client::mqtt::{MqttPayload, Topic};
66
use iota_sdk::{
77
client::{
8+
Client,
89
api::{PreparedTransactionData, PreparedTransactionDataDto},
9-
request_funds_from_faucet, Client,
10+
request_funds_from_faucet,
1011
},
1112
types::{
13+
TryFromDto,
1214
api::core::response::OutputWithMetadataResponse,
1315
block::{
16+
Block, BlockDto,
1417
input::dto::UtxoInputDto,
1518
output::{
16-
dto::{OutputBuilderAmountDto, OutputDto},
1719
AliasOutput, BasicOutput, FoundryOutput, NftOutput, Output, Rent,
20+
dto::{OutputBuilderAmountDto, OutputDto},
1821
},
19-
payload::{dto::MilestonePayloadDto, Payload},
20-
Block, BlockDto,
22+
payload::{Payload, dto::MilestonePayloadDto},
2123
},
22-
TryFromDto,
2324
},
2425
};
2526

26-
use crate::{method::ClientMethod, response::Response, Result};
27+
use crate::{Result, method::ClientMethod, response::Response};
2728

2829
/// Listen to MQTT events
2930
#[cfg(feature = "mqtt")]

bindings/core/src/method_handler/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod utils;
99
mod wallet;
1010

1111
pub use call_method::{
12-
call_client_method, call_secret_manager_method, call_utils_method, call_wallet_method, CallMethod,
12+
CallMethod, call_client_method, call_secret_manager_method, call_utils_method, call_wallet_method,
1313
};
1414
#[cfg(feature = "mqtt")]
1515
pub use client::listen_mqtt;

bindings/core/src/method_handler/secret_manager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use iota_sdk::{
77
secret::{SecretManage, SecretManager},
88
},
99
types::{
10-
block::{signature::dto::Ed25519SignatureDto, unlock::Unlock},
1110
TryFromDto,
11+
block::{signature::dto::Ed25519SignatureDto, unlock::Unlock},
1212
},
1313
};
1414
use tokio::sync::RwLock;
1515

16-
use crate::{method::SecretManagerMethod, response::Response, Result};
16+
use crate::{Result, method::SecretManagerMethod, response::Response};
1717

1818
/// Call a secret manager method.
1919
pub(crate) async fn call_secret_manager_method_internal(

bindings/core/src/method_handler/utils.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
use crypto::keys::bip39::Mnemonic;
55
use iota_sdk::{
66
client::{
7-
api::verify_semantic, hex_public_key_to_bech32_address, hex_to_bech32, secret::types::InputSigningData,
8-
verify_mnemonic, Client,
7+
Client, api::verify_semantic, hex_public_key_to_bech32_address, hex_to_bech32, secret::types::InputSigningData,
8+
verify_mnemonic,
99
},
1010
types::{
11+
TryFromDto,
1112
block::{
12-
address::{dto::AddressDto, Address, AliasAddress, ToBech32Ext},
13+
Block, Error,
14+
address::{Address, AliasAddress, ToBech32Ext, dto::AddressDto},
1315
input::UtxoInput,
1416
output::{AliasId, FoundryId, InputsCommitment, NftId, Output, OutputId, Rent, TokenId},
15-
payload::{transaction::TransactionEssence, MilestonePayload, TransactionPayload},
17+
payload::{MilestonePayload, TransactionPayload, transaction::TransactionEssence},
1618
signature::Ed25519Signature,
17-
Block, Error,
1819
},
19-
TryFromDto,
2020
},
2121
};
2222
use packable::PackableExt;
2323

24-
use crate::{method::UtilsMethod, response::Response, Result};
24+
use crate::{Result, method::UtilsMethod, response::Response};
2525

2626
/// Call a utils method.
2727
pub(crate) fn call_utils_method_internal(method: UtilsMethod) -> Result<Response> {

bindings/core/src/method_handler/wallet.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ use std::time::Duration;
55

66
use iota_sdk::{
77
types::block::address::ToBech32Ext,
8-
wallet::{account::AccountDetailsDto, Wallet},
8+
wallet::{Wallet, account::AccountDetailsDto},
99
};
1010

1111
use super::account::call_account_method_internal;
12-
use crate::{method::WalletMethod, response::Response, Result};
12+
use crate::{Result, method::WalletMethod, response::Response};
1313

1414
/// Call a wallet method.
1515
pub(crate) async fn call_wallet_method_internal(wallet: &Wallet, method: WalletMethod) -> Result<Response> {

bindings/core/src/panic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
use std::{
55
any::Any,
6-
panic::{catch_unwind, AssertUnwindSafe},
6+
panic::{AssertUnwindSafe, catch_unwind},
77
};
88

99
use backtrace::Backtrace;
1010
use futures::{Future, FutureExt};
1111

12-
use crate::{response::Response, Result};
12+
use crate::{Result, response::Response};
1313

1414
fn panic_to_response_message(panic: Box<dyn Any>) -> Response {
1515
let msg = panic.downcast_ref::<String>().map_or_else(
@@ -58,7 +58,7 @@ pub(crate) fn convert_panics<F: FnOnce() -> Result<Response>>(f: F) -> Result<Re
5858

5959
#[cfg(test)]
6060
mod tests {
61-
use super::super::{panic::convert_async_panics, Response};
61+
use super::super::{Response, panic::convert_async_panics};
6262

6363
#[tokio::test]
6464
async fn panic_to_response() {

bindings/core/src/response.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use derivative::Derivative;
1010
use iota_sdk::client::secret::LedgerNanoStatus;
1111
use iota_sdk::{
1212
client::{
13+
NetworkInfo, NodeInfoWrapper,
1314
api::{PreparedTransactionDataDto, SignedTransactionDataDto},
1415
node_manager::node::Node,
15-
NetworkInfo, NodeInfoWrapper,
1616
},
1717
types::{
1818
api::{
@@ -23,9 +23,10 @@ use iota_sdk::{
2323
plugins::indexer::OutputIdsResponse,
2424
},
2525
block::{
26-
address::{dto::AddressDto, Bech32Address, Hrp},
26+
BlockDto, BlockId,
27+
address::{Bech32Address, Hrp, dto::AddressDto},
2728
input::dto::UtxoInputDto,
28-
output::{dto::OutputDto, AliasId, FoundryId, NftId, OutputId, OutputMetadata, TokenId},
29+
output::{AliasId, FoundryId, NftId, OutputId, OutputMetadata, TokenId, dto::OutputDto},
2930
payload::{
3031
dto::{MilestonePayloadDto, TransactionPayloadDto},
3132
milestone::MilestoneId,
@@ -35,12 +36,11 @@ use iota_sdk::{
3536
semantic::ConflictReason,
3637
signature::dto::Ed25519SignatureDto,
3738
unlock::dto::UnlockDto,
38-
BlockDto, BlockId,
3939
},
4040
},
4141
wallet::account::{
42-
types::{AccountAddress, AddressWithUnspentOutputs, Balance, OutputDataDto, TransactionDto},
4342
AccountDetailsDto, PreparedCreateNativeTokenTransactionDto,
43+
types::{AccountAddress, AddressWithUnspentOutputs, Balance, OutputDataDto, TransactionDto},
4444
},
4545
};
4646
use serde::Serialize;
@@ -50,7 +50,7 @@ use {
5050
iota_sdk::wallet::account::{AccountParticipationOverview, ParticipationEventWithNodes},
5151
};
5252

53-
use crate::{error::Error, OmittedDebug};
53+
use crate::{OmittedDebug, error::Error};
5454

5555
/// The response message.
5656
#[derive(Serialize, Derivative)]

bindings/core/tests/combined.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::collections::BTreeMap;
55

66
use iota_sdk::{
7-
client::{constants::SHIMMER_COIN_TYPE, secret::SecretManagerDto, ClientBuilder},
7+
client::{ClientBuilder, constants::SHIMMER_COIN_TYPE, secret::SecretManagerDto},
88
wallet::account::types::AccountIdentifier,
99
};
1010
use iota_sdk_bindings_core::{AccountMethod, CallMethod, ClientMethod, Response, Result, WalletMethod, WalletOptions};

bindings/core/tests/secrets_manager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::sync::Arc;
55

66
use iota_sdk::client::{api::GetAddressesOptions, constants::ETHER_COIN_TYPE, secret::SecretManager};
7-
use iota_sdk_bindings_core::{call_secret_manager_method, Response, Result, SecretManagerMethod};
7+
use iota_sdk_bindings_core::{Response, Result, SecretManagerMethod, call_secret_manager_method};
88
use pretty_assertions::assert_eq;
99
use tokio::sync::RwLock;
1010

bindings/core/tests/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use iota_sdk::types::block::address::{Bech32Address, Hrp};
5-
use iota_sdk_bindings_core::{call_utils_method, Response, Result, UtilsMethod};
5+
use iota_sdk_bindings_core::{Response, Result, UtilsMethod, call_utils_method};
66
use pretty_assertions::assert_eq;
77

88
#[tokio::test]

bindings/nodejs/src/client.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use std::sync::Arc;
55

66
use iota_sdk_bindings_core::{
7-
call_client_method as rust_call_client_method,
8-
iota_sdk::client::{mqtt::Topic, Client, ClientBuilder},
9-
listen_mqtt as rust_listen_mqtt, ClientMethod, Response, Result,
7+
ClientMethod, Response, Result, call_client_method as rust_call_client_method,
8+
iota_sdk::client::{Client, ClientBuilder, mqtt::Topic},
9+
listen_mqtt as rust_listen_mqtt,
1010
};
1111
use neon::prelude::*;
1212
use tokio::sync::RwLock;

0 commit comments

Comments
 (0)