Skip to content

Commit c18d30b

Browse files
r-nearvsavchyn-dev
andauthored
chore: upgrade to Rust edition 2024 (#118)
* chore: upgrade to Rust edition 2024 * chore: cargo fmt fixes * Fix: Update specifying_block example to use final block reference * chore: change example a bit * fix: ignore clippy's directive as this thing looks like intended usage --------- Co-authored-by: Vladyslav Savchyn <vsavchyn2005@gmail.com>
1 parent e95fdc2 commit c18d30b

Some content is hidden

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

45 files changed

+167
-148
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = ["api", "types"]
44
rust-version = "1.85"
55

66
[workspace.package]
7-
edition = "2021"
7+
edition = "2024"
88
version = "0.8.3"
99
authors = [
1010
"akorchyn <artur.yurii.korchynskyi@gmail.com>",

api/examples/account_key_pooling.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
/// This is an example of how to use account key pooling to send multiple transactions
55
/// using different keys.
66
use near_api::{
7+
Account, NetworkConfig, Signer, Tokens,
78
signer::generate_secret_key,
89
types::{AccessKeyPermission, AccountId, NearToken},
9-
Account, NetworkConfig, Signer, Tokens,
1010
};
1111
use near_sandbox::{
12-
config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY},
1312
GenesisAccount, SandboxConfig,
13+
config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY},
1414
};
1515
use testresult::TestResult;
1616

api/examples/contract_source_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::str::FromStr;
22

3-
use near_api::{types::AccountId, Contract};
3+
use near_api::{Contract, types::AccountId};
44
use testresult::TestResult;
55

66
#[tokio::main]

api/examples/create_account_and_send_near.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use near_api::{
2+
Account, NetworkConfig, Signer, Tokens,
23
signer::generate_secret_key,
34
types::{AccountId, NearToken},
4-
Account, NetworkConfig, Signer, Tokens,
55
};
66
use near_sandbox::config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY};
77
use testresult::TestResult;

api/examples/deploy_and_call_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use near_api::{
2-
types::{AccountId, Data},
32
Contract, NetworkConfig, Signer,
3+
types::{AccountId, Data},
44
};
55
use near_sandbox::config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY};
66
use testresult::TestResult;

api/examples/ft.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use near_api::{
2-
types::{tokens::FTBalance, AccountId},
32
Contract, NetworkConfig, Signer, Tokens,
3+
types::{AccountId, tokens::FTBalance},
44
};
5-
use near_sandbox::{config::DEFAULT_GENESIS_ACCOUNT, GenesisAccount, SandboxConfig};
5+
use near_sandbox::{GenesisAccount, SandboxConfig, config::DEFAULT_GENESIS_ACCOUNT};
66

77
use serde_json::json;
88
use testresult::TestResult;

api/examples/global_deploy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use near_api::{types::CryptoHash, Contract, NetworkConfig, Signer};
1+
use near_api::{Contract, NetworkConfig, Signer, types::CryptoHash};
22
use near_sandbox::{GenesisAccount, SandboxConfig};
33

44
#[tokio::main]

api/examples/nft.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use near_api::{
2-
types::{nft::TokenMetadata, AccountId, NearToken},
32
Contract, NetworkConfig, Signer, Tokens,
3+
types::{AccountId, NearToken, nft::TokenMetadata},
44
};
55
use near_sandbox::{
6-
config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY},
76
GenesisAccount, SandboxConfig,
7+
config::{DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY},
88
};
99
use serde_json::json;
1010

api/examples/sign_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::str::FromStr;
22

33
use near_api::{
4+
Account, NetworkConfig, PublicKey, Signer,
45
signer::generate_seed_phrase_with_passphrase,
56
types::{AccessKeyPermission, AccountId},
6-
Account, NetworkConfig, PublicKey, Signer,
77
};
88
use near_sandbox::config::{
99
DEFAULT_GENESIS_ACCOUNT, DEFAULT_GENESIS_ACCOUNT_PRIVATE_KEY,

api/examples/specify_backup_rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use near_api::{types::Reference, Chain, NetworkConfig, RPCEndpoint};
1+
use near_api::{Chain, NetworkConfig, RPCEndpoint, types::Reference};
22

33
#[tokio::main]
44
async fn main() -> testresult::TestResult {

0 commit comments

Comments
 (0)