Skip to content

Commit 8eac017

Browse files
committed
feat: update rust to 1.93 and improve code structure with new lints
1 parent c6200c7 commit 8eac017

File tree

27 files changed

+74
-43
lines changed

27 files changed

+74
-43
lines changed

Cargo.lock

Lines changed: 15 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ members = [
1414
"sdk"
1515
]
1616

17+
[workspace.lints.clippy]
18+
all = { level = "deny", priority = -1 }
19+
pedantic = { level = "deny", priority = -1 }
20+
nursery = { level = "deny", priority = -1 }
21+
missing_errors_doc = "allow"
22+
missing_panics_doc = "allow"
23+
result_large_err = "allow" # TODO: Remove this when we have better error types in place
24+
1725
[workspace.dependencies]
1826
anyhow = "1"
1927
aurora-engine-precompiles = { version = "2", features = ["std"] }
@@ -45,4 +53,4 @@ serde_json = "1"
4553
shadow-rs = "1"
4654
thiserror = "2"
4755
tokio = { version = "1", features = ["full"] }
48-
toml = "0.9"
56+
toml = "1"

cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ path = "src/lib.rs"
1717
name = "aurora-cli"
1818
path = "src/main.rs"
1919

20+
[lints]
21+
workspace = true
22+
2023
[features]
2124
default = ["simple"]
2225
simple = ["toml"]

cli/src/cli/advanced/aurora.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use aurora_engine_types::types::Address;
33
use aurora_engine_types::{U256, types::Wei};
44
use clap::Subcommand;
55

6-
use crate::{client::AuroraClient, config::Config, utils};
6+
use crate::cli::advanced::Config;
7+
use crate::{client::AuroraClient, utils};
78

89
#[derive(Subcommand)]
910
pub enum Command {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use serde::{Deserialize, Serialize};
2-
#[cfg(feature = "advanced")]
32
use std::path::Path;
43

54
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -11,7 +10,6 @@ pub struct Config {
1110
pub evm_secret_key: Option<String>,
1211
}
1312

14-
#[cfg(feature = "advanced")]
1513
impl Config {
1614
pub fn from_file<P: AsRef<Path>>(path: P) -> anyhow::Result<Self> {
1715
std::fs::File::open(path)

cli/src/cli/advanced/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use clap::{Parser, Subcommand};
22

3-
use crate::config::{Config, Network};
3+
use crate::cli::advanced::config::{Config, Network};
44

55
pub mod aurora;
6+
pub mod config;
67
pub mod erc20;
78
pub mod near;
89
pub mod process_tx_data;

cli/src/cli/advanced/near.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
use crate::{
2-
config::{Config, Network},
3-
utils,
4-
};
51
use aurora_engine_types::borsh::BorshDeserialize;
62
use aurora_engine_types::parameters::connector::PauseEthConnectorArgs;
73
use aurora_engine_types::parameters::engine::{
@@ -24,6 +20,9 @@ use near_primitives::{
2420
};
2521
use std::{path::Path, str::FromStr};
2622

23+
use crate::cli::advanced::{Config, Network};
24+
use crate::utils;
25+
2726
/// Chain ID for Aurora localnet, per the documentation on
2827
/// <https://doc.aurora.dev/getting-started/network-endpoints>
2928
#[allow(clippy::unreadable_literal)]
@@ -252,6 +251,7 @@ pub enum InitCommand {
252251
},
253252
}
254253

254+
#[allow(clippy::too_many_lines)]
255255
pub async fn execute_command(
256256
command: Command,
257257
client: &NearClient,
@@ -638,7 +638,7 @@ pub async fn execute_command(
638638
key_file
639639
.write_to_file(&key_path)
640640
.expect("Failed to write Aurora access key file");
641-
println!("Aurora access key written to {key_path:?}");
641+
println!("Aurora access key written to {}", key_path.display());
642642
}
643643
InitCommand::LocalConfig {
644644
nearcore_config_path,

cli/src/cli/advanced/solidity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Solidity {
8787
}
8888
}
8989

90-
fn read_arg(arg: Option<&str>, stdin_arg: Option<bool>) -> Cow<str> {
90+
fn read_arg(arg: Option<&str>, stdin_arg: Option<bool>) -> Cow<'_, str> {
9191
arg.map_or_else(
9292
|| match stdin_arg {
9393
Some(true) => {

cli/src/cli/simple/command/silo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl Display for FixedGas {
205205
let value = self
206206
.0
207207
.fixed_gas
208-
.map_or("none".to_string(), |cost| cost.to_string());
208+
.map_or_else(|| "none".to_string(), |cost| cost.to_string());
209209
f.write_str(&value)
210210
}
211211
}

cli/src/cli/simple/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ impl FromStr for WithdrawSerialization {
452452
}
453453
}
454454

455+
#[allow(clippy::too_many_lines)]
455456
pub async fn run(args: Cli) -> anyhow::Result<()> {
456457
let near_rpc = parse_near_rpc(&args.network)?;
457458
let client = crate::client::Client::new(&near_rpc, &args.engine, args.near_key_path);

0 commit comments

Comments
 (0)