Skip to content
Snippets Groups Projects
Commit a03e7e9a authored by pini's avatar pini
Browse files

Merge branch 'pini-fmt-and-clippy' into 'dev'

chore: fix fmt_and_clippy and cargo-deny CI failures

See merge request !1411
parents 58760841 ed831b78
Branches
No related tags found
1 merge request!1411chore: fix fmt_and_clippy and cargo-deny CI failures
Pipeline #19109 failed
[advisories] [advisories]
ignore = [ ignore = [
# Wait to comfy-table upgrade crossterm # Won't fix
"RUSTSEC-2020-0091", "RUSTSEC-2020-0071",
# generic-array v0.12.3 allowed unsoundly extending lifetimes "RUSTSEC-2020-0159",
# but used only on build-dependencies by pest_meta "RUSTSEC-2021-0072",
"RUSTSEC-2020-0146", "RUSTSEC-2021-0078",
"RUSTSEC-2021-0079",
"RUSTSEC-2021-0093",
"RUSTSEC-2021-0114",
"RUSTSEC-2021-0115",
"RUSTSEC-2021-0119",
"RUSTSEC-2021-0124",
"RUSTSEC-2022-0013",
"RUSTSEC-2022-0037",
"RUSTSEC-2022-0082",
"RUSTSEC-2023-0018",
] ]
[bans] [bans]
......
...@@ -76,7 +76,7 @@ fn main() -> anyhow::Result<()> { ...@@ -76,7 +76,7 @@ fn main() -> anyhow::Result<()> {
"duniter_default".to_owned() "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); let data_path = profile_path.as_path().join(DATA_DIR);
if !data_path.exists() { if !data_path.exists() {
...@@ -323,11 +323,11 @@ fn too_many_entries(entries_len: usize, output_in_term: bool) -> std::io::Result ...@@ -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)>) { fn show_db_schema(collections_names: Vec<(&'static str, &'static str, &'static str)>) {
let mut table = Table::new(); let mut table = Table::new();
table.set_content_arrangement(comfy_table::ContentArrangement::Dynamic); 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 { 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 key_type_name_opt = key_full_type_name.split(':').last();
let value_type_name_opt = value_full_type_name.split(':').last(); let value_type_name_opt = value_full_type_name.split(':').last();
table.add_row(&[ table.add_row([
collection_name, collection_name,
key_type_name_opt.unwrap_or("?"), key_type_name_opt.unwrap_or("?"),
value_type_name_opt.unwrap_or("?"), value_type_name_opt.unwrap_or("?"),
......
...@@ -44,7 +44,7 @@ fn main() -> Result<()> { ...@@ -44,7 +44,7 @@ fn main() -> Result<()> {
let args = DuniterXTask::from_args(); let args = DuniterXTask::from_args();
if !version_check::is_min_version(MIN_RUST_VERSION).unwrap_or(false) 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!( eprintln!(
"Duniter requires Rust {} or higher. If you installed the Rust toolchain via rustup, please execute the command `rustup update stable`.", "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<()> { ...@@ -110,24 +110,24 @@ fn exec_should_success(command: &mut Command) -> Result<()> {
fn build(skip_npm: bool, production: bool) -> Result<()> { fn build(skip_npm: bool, production: bool) -> Result<()> {
if !skip_npm { 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( exec_should_success(
Command::new("npm") Command::new("npm")
.env("NEON_BUILD_RELEASE", "true") .env("NEON_BUILD_RELEASE", "true")
.arg("ci"), .arg("ci"),
)?; )?;
if production { if production {
exec_should_success(Command::new("npm").args(&["prune", "--production"]))?; exec_should_success(Command::new("npm").args(["prune", "--production"]))?;
} }
} }
println!("Build duniter-cli …"); 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")?; std::fs::copy("target/release/duniter", "bin/duniter")?;
Ok(()) Ok(())
} }
fn test(skip_npm: bool) -> Result<()> { 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 { if !skip_npm {
exec_should_success(Command::new("npm").arg("test"))?; exec_should_success(Command::new("npm").arg("test"))?;
} }
......
...@@ -62,7 +62,7 @@ impl DuniterServer { ...@@ -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( pub fn get_pending_txs(
&self, &self,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment