diff --git a/rust-bins/duniter-dbex/src/main.rs b/rust-bins/duniter-dbex/src/main.rs index 977d8df5cd511580f906e20a3859cdb0b87b80ec..28a0c0b362d1df741cdfe27ae56e3ee99e770f93 100644 --- a/rust-bins/duniter-dbex/src/main.rs +++ b/rust-bins/duniter-dbex/src/main.rs @@ -76,7 +76,7 @@ fn main() -> anyhow::Result<()> { "duniter_default".to_owned() }; - let profile_path = home.as_path().join(&profile_name); + let profile_path = home.as_path().join(profile_name); let data_path = profile_path.as_path().join(DATA_DIR); if !data_path.exists() { @@ -323,11 +323,11 @@ fn too_many_entries(entries_len: usize, output_in_term: bool) -> std::io::Result fn show_db_schema(collections_names: Vec<(&'static str, &'static str, &'static str)>) { let mut table = Table::new(); table.set_content_arrangement(comfy_table::ContentArrangement::Dynamic); - table.set_header(&["Collection name", "Key type", "Value type"]); + table.set_header(["Collection name", "Key type", "Value type"]); for (collection_name, key_full_type_name, value_full_type_name) in collections_names { let key_type_name_opt = key_full_type_name.split(':').last(); let value_type_name_opt = value_full_type_name.split(':').last(); - table.add_row(&[ + table.add_row([ collection_name, key_type_name_opt.unwrap_or("?"), value_type_name_opt.unwrap_or("?"), diff --git a/rust-bins/xtask/src/main.rs b/rust-bins/xtask/src/main.rs index ed7c83bc394e48f4e52bb113f1c20b9e25eb3651..ef59f9f58ff6fce857e5aeec4ae0ad825e4a0b03 100644 --- a/rust-bins/xtask/src/main.rs +++ b/rust-bins/xtask/src/main.rs @@ -44,7 +44,7 @@ fn main() -> Result<()> { let args = DuniterXTask::from_args(); if !version_check::is_min_version(MIN_RUST_VERSION).unwrap_or(false) - && exec_should_success(Command::new("rustup").args(&["update", "stable"])).is_err() + && exec_should_success(Command::new("rustup").args(["update", "stable"])).is_err() { eprintln!( "Duniter requires Rust {} or higher. If you installed the Rust toolchain via rustup, please execute the command `rustup update stable`.", @@ -110,24 +110,24 @@ fn exec_should_success(command: &mut Command) -> Result<()> { fn build(skip_npm: bool, production: bool) -> Result<()> { if !skip_npm { - exec_should_success(Command::new("npm").args(&["add", "duniter-ui"]))?; + exec_should_success(Command::new("npm").args(["add", "duniter-ui"]))?; exec_should_success( Command::new("npm") .env("NEON_BUILD_RELEASE", "true") .arg("ci"), )?; if production { - exec_should_success(Command::new("npm").args(&["prune", "--production"]))?; + exec_should_success(Command::new("npm").args(["prune", "--production"]))?; } } println!("Build duniter-cli …"); - exec_should_success(Command::new("cargo").args(&["build", "--release"]))?; + exec_should_success(Command::new("cargo").args(["build", "--release"]))?; std::fs::copy("target/release/duniter", "bin/duniter")?; Ok(()) } fn test(skip_npm: bool) -> Result<()> { - exec_should_success(Command::new("cargo").args(&["test", "--all"]))?; + exec_should_success(Command::new("cargo").args(["test", "--all"]))?; if !skip_npm { exec_should_success(Command::new("npm").arg("test"))?; } diff --git a/rust-libs/duniter-server/src/legacy/txs_mempool.rs b/rust-libs/duniter-server/src/legacy/txs_mempool.rs index bcb78807b2d76ffae8d292746cc581badd787a48..1e7e57318de3714535bc7fcb276c65923492ac42 100644 --- a/rust-libs/duniter-server/src/legacy/txs_mempool.rs +++ b/rust-libs/duniter-server/src/legacy/txs_mempool.rs @@ -62,7 +62,7 @@ impl DuniterServer { } } } - Ok(new_pending_txs.into_iter().map(|(_k, v)| v).collect()) + Ok(new_pending_txs.into_values().collect()) } pub fn get_pending_txs( &self,