Skip to content

Commit b289a61

Browse files
committed
fix clippy warnings
1 parent c2573fc commit b289a61

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ pub(crate) async fn handle_online_wallet_subcommand(
554554
mut warning_subscriber,
555555
update_subscriber: _,
556556
node,
557-
} = client;
557+
} = *client;
558558

559559
let subscriber = tracing_subscriber::FmtSubscriber::new();
560560
tracing::subscriber::set_global_default(subscriber)

src/utils.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub(crate) enum BlockchainClient {
140140
},
141141

142142
#[cfg(feature = "cbf")]
143-
KyotoClient { client: LightClient },
143+
KyotoClient { client: Box<LightClient> },
144144
}
145145

146146
#[cfg(any(
@@ -206,7 +206,9 @@ pub(crate) fn new_blockchain_client(
206206
.data_dir(&_datadir)
207207
.build_with_wallet(_wallet, scan_type)?;
208208

209-
BlockchainClient::KyotoClient { client }
209+
BlockchainClient::KyotoClient {
210+
client: Box::new(client),
211+
}
210212
}
211213
};
212214
Ok(client)
@@ -323,15 +325,15 @@ pub async fn trace_logger(
323325

324326
// Handle Kyoto Client sync
325327
#[cfg(feature = "cbf")]
326-
pub async fn sync_kyoto_client(wallet: &mut Wallet, client: LightClient) -> Result<(), Error> {
328+
pub async fn sync_kyoto_client(wallet: &mut Wallet, client: Box<LightClient>) -> Result<(), Error> {
327329
let LightClient {
328330
requester,
329331
log_subscriber,
330332
info_subscriber,
331333
warning_subscriber,
332334
mut update_subscriber,
333335
node,
334-
} = client;
336+
} = *client;
335337

336338
let subscriber = tracing_subscriber::FmtSubscriber::new();
337339
tracing::subscriber::set_global_default(subscriber)

tests/integration.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod test {
2020
use std::process::Command;
2121

2222
/// Testing errors for integration tests
23+
#[allow(dead_code)]
2324
#[derive(Debug)]
2425
enum IntTestError {
2526
// IO error
@@ -38,11 +39,12 @@ mod test {
3839

3940
// Helper function
4041
// Runs a system command with given args
42+
#[allow(dead_code)]
4143
fn run_cmd_with_args(cmd: &str, args: &[&str]) -> Result<serde_json::Value, IntTestError> {
4244
let output = Command::new(cmd).args(args).output().unwrap();
4345
let mut value = output.stdout;
4446
let error = output.stderr;
45-
if value.len() == 0 {
47+
if value.is_empty() {
4648
return Err(IntTestError::CmdExec(String::from_utf8(error).unwrap()));
4749
}
4850
value.pop(); // remove `\n` at end
@@ -56,6 +58,7 @@ mod test {
5658

5759
// Helper Function
5860
// Transforms a json value to string
61+
#[allow(dead_code)]
5962
fn value_to_string(value: &Value) -> Result<String, IntTestError> {
6063
match value {
6164
Value::Bool(bool) => match bool {
@@ -72,6 +75,7 @@ mod test {
7275

7376
// Helper Function
7477
// Extracts value from a given json object and key
78+
#[allow(dead_code)]
7579
fn get_value(json: &Value, key: &str) -> Result<String, IntTestError> {
7680
let map = json
7781
.as_object()
@@ -86,6 +90,7 @@ mod test {
8690

8791
/// The bdk-cli command struct
8892
/// Use it to perform all bdk-cli operations
93+
#[allow(dead_code)]
8994
#[derive(Debug)]
9095
struct BdkCli {
9196
target: String,
@@ -108,10 +113,10 @@ mod test {
108113
let mut feat = "--features=".to_string();
109114
for item in features {
110115
feat.push_str(item);
111-
feat.push_str(",");
116+
feat.push(',');
112117
}
113118
feat.pop(); // remove the last comma
114-
let _build = Command::new("cargo").args(&["build", &feat]).output()?;
119+
let _build = Command::new("cargo").args(["build", &feat]).output()?;
115120

116121
let mut bdk_cli = Self {
117122
target: "./target/debug/bdk-cli".to_string(),
@@ -159,7 +164,7 @@ mod test {
159164
wallet_args.push("-d");
160165
wallet_args.push(self.recv_desc.as_ref().unwrap());
161166
wallet_args.push("-c");
162-
wallet_args.push(&self.chang_desc.as_ref().unwrap());
167+
wallet_args.push(self.chang_desc.as_ref().unwrap());
163168

164169
for arg in args {
165170
wallet_args.push(arg);
@@ -195,6 +200,7 @@ mod test {
195200

196201
// Run A Basic wallet operation test, with given feature
197202
#[cfg(test)]
203+
#[allow(dead_code)]
198204
fn basic_wallet_ops(feature: &str) {
199205
// Create a temporary directory for testing env
200206
let mut test_dir = std::env::current_dir().unwrap();

0 commit comments

Comments
 (0)