From 687370589596c17eb266005451247e4353fbc730 Mon Sep 17 00:00:00 2001 From: Thomas Versteeg Date: Sun, 14 Nov 2021 12:48:12 +0100 Subject: [PATCH] Update dependencies & fix clippy warnings --- Cargo.lock | 186 ++++++++++++++++++++---------------- Cargo.toml | 10 +- src/config.rs | 1 - src/history.rs | 1 - src/init.rs | 10 +- src/main.rs | 9 +- src/package.rs | 2 +- src/package_manager_impl.rs | 7 +- src/repo.rs | 4 +- 9 files changed, 119 insertions(+), 111 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a21a25fe5..4611bc3f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,10 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "addr2line" -version = "0.15.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] @@ -43,9 +45,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.59" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" dependencies = [ "addr2line", "cc", @@ -64,9 +66,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bugreport" @@ -87,9 +89,9 @@ checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" [[package]] name = "cc" -version = "1.0.67" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" [[package]] name = "cfg-if" @@ -112,9 +114,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.2" +version = "3.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" +checksum = "feff3878564edb93745d58cf63e17b63f24142506e7a20c87a5521ed7bfb1d63" dependencies = [ "atty", "bitflags", @@ -126,15 +128,14 @@ dependencies = [ "termcolor", "terminal_size", "textwrap", - "unicode-width", - "vec_map", + "unicase", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.2" +version = "3.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" +checksum = "8b15c6b4f786ffb6192ffe65a36855bc1fc2444bcd0945ae16748dcd6ed7d0d3" dependencies = [ "heck", "proc-macro-error", @@ -145,9 +146,9 @@ dependencies = [ [[package]] name = "clap_generate" -version = "3.0.0-beta.2" +version = "3.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf420f8b687b628d2915ccfd43a660c437a170432e3fbcb66944e8717a0d68f" +checksum = "097ab5db1c3417442270cd57c8dd39f6c3114d3ce09d595f9efddbb1fcfaa799" dependencies = [ "clap", ] @@ -165,13 +166,13 @@ dependencies = [ [[package]] name = "console" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "regex", "terminal_size", "unicode-width", @@ -180,9 +181,9 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9dd058f8b65922819fabb4a41e7d1964e56344042c26efbccd465202c23fa0c" +checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb" dependencies = [ "console", "lazy_static", @@ -279,9 +280,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if", "libc", @@ -290,15 +291,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "git-version" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94918e83f1e01dedc2e361d00ce9487b14c58c7f40bab148026fa39d42cb41e2" +checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" dependencies = [ "git-version-macro", "proc-macro-hack", @@ -306,9 +307,9 @@ dependencies = [ [[package]] name = "git-version-macro" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a97a52fdee1870a34fa6e4b77570cba531b27d1838874fef4429a791a3d657" +checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -318,33 +319,33 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "indexmap" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown", @@ -376,9 +377,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.94" +version = "0.2.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" +checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" [[package]] name = "log" @@ -389,6 +390,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + [[package]] name = "miniz_oxide" version = "0.4.4" @@ -420,27 +427,33 @@ dependencies = [ [[package]] name = "object" -version = "0.24.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "os_str_bytes" -version = "2.4.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" +checksum = "addaa943333a514159c80c97ff4a93306530d965d27e139188283cd13e06a799" +dependencies = [ + "memchr", +] [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-error" @@ -474,27 +487,27 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", "rand_chacha", @@ -504,9 +517,9 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", @@ -514,27 +527,27 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ "rand_core", ] [[package]] name = "redox_syscall" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] @@ -575,9 +588,9 @@ dependencies = [ [[package]] name = "ron" -version = "0.6.5" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45005aa836116903a49cf3461474da697cfe66221762c6e95871092009ec86d6" +checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" dependencies = [ "base64", "bitflags", @@ -595,9 +608,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "serde" @@ -662,9 +675,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.72" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -673,9 +686,9 @@ dependencies = [ [[package]] name = "sys-info" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33fcecee49339531cf6bd84ecf3ed94f9c8ef4a7e700f2a1cac9cc1ca485383a" +checksum = "0b3a0d0aba8bf96a0e1ddfdc352fc53b3df7f39318c71854910c3c4b024ae52c" dependencies = [ "cc", "libc", @@ -706,9 +719,9 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ca8ced750734db02076f44132d802af0b33b09942331f4459dde8636fd2406" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" dependencies = [ "libc", "winapi", @@ -716,9 +729,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.12.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" dependencies = [ "terminal_size", "unicode-width", @@ -743,17 +756,26 @@ dependencies = [ "serde", ] +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -777,12 +799,6 @@ dependencies = [ "log", ] -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.3" @@ -828,6 +844,6 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "zeroize" -version = "1.3.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" diff --git a/Cargo.toml b/Cargo.toml index d53673ece..95baaa228 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,16 +18,16 @@ is-it-maintained-open-issues = { repository = "tversteeg/emplace" } [dependencies] anyhow = { version = "1.0.45", features = ["backtrace"] } bugreport = "0.4.1" -clap = { version = "=3.0.0-beta.2", features = ["suggestions", "color", "wrap_help"] } -clap_generate = "=3.0.0-beta.2" +clap = { version = "3.0.0-beta.5", features = ["suggestions", "color", "wrap_help"] } +clap_generate = "3.0.0-beta.5" colored = "2.0.0" -console = "0.14.1" -dialoguer = "0.8.0" +console = "0.15.0" +dialoguer = "0.9.0" dirs = "4.0.0" enum_dispatch = "0.3.7" itertools = "0.10.1" log = "0.4.14" -ron = "0.6.5" +ron = "0.7.0" run_script = "0.9.0" serde = { version = "1.0.130", features = ["derive"] } simplelog = "0.11.0" diff --git a/src/config.rs b/src/config.rs index da7c3043b..f90b56028 100644 --- a/src/config.rs +++ b/src/config.rs @@ -106,7 +106,6 @@ impl Config { let chosen_in = dialoguer::Select::with_theme(&*theme) .with_prompt(prompt) .items(choices_in) - .paged(true) .clear(true) .interact_on(&term)?; if chosen_in == 0 { diff --git a/src/history.rs b/src/history.rs index ff89ef25f..6e6527cab 100644 --- a/src/history.rs +++ b/src/history.rs @@ -56,7 +56,6 @@ where MultiSelect::new() .items(&colored_selection) .with_prompt("Select packages to sync") - .paged(true) .interact()? }; diff --git a/src/init.rs b/src/init.rs index 0c5723320..4ecb9765b 100644 --- a/src/init.rs +++ b/src/init.rs @@ -33,7 +33,7 @@ where .as_ref() .canonicalize() // When canonicalizing path failed use the default path - .unwrap_or(Config::default_path()) + .unwrap_or_else(|_| Config::default_path()) .to_str() .ok_or_else(|| { anyhow!( @@ -47,13 +47,11 @@ where // Print the completions match shell_name { "bash" => { - clap_generate::generate::(&mut public_clap_app(), "emplace", &mut io::stdout()) - } - "zsh" => { - clap_generate::generate::(&mut public_clap_app(), "emplace", &mut io::stdout()) + clap_generate::generate(Bash, &mut public_clap_app(), "emplace", &mut io::stdout()) } + "zsh" => clap_generate::generate(Zsh, &mut public_clap_app(), "emplace", &mut io::stdout()), "fish" => { - clap_generate::generate::(&mut public_clap_app(), "emplace", &mut io::stdout()) + clap_generate::generate(Fish, &mut public_clap_app(), "emplace", &mut io::stdout()) } _ => (), }; diff --git a/src/main.rs b/src/main.rs index 49fbf48c7..1ff28971b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,9 +21,9 @@ use bugreport::{ }, format::Markdown, }; -use clap::{App, AppSettings, Arg}; +use clap::{App, AppSettings, Arg, ColorChoice}; use log::error; -use simplelog::{ColorChoice, LevelFilter, TermLogger, TerminalMode}; +use simplelog::{ColorChoice as LogColorChoice, LevelFilter, TermLogger, TerminalMode}; use std::path::PathBuf; fn public_clap_app<'a>() -> App<'a> { @@ -35,8 +35,7 @@ fn public_clap_app<'a>() -> App<'a> { .setting(AppSettings::DeriveDisplayOrder) .setting(AppSettings::SubcommandRequiredElseHelp) // Print the help in colors if the terminal allows it - .global_setting(AppSettings::ColorAuto) - .global_setting(AppSettings::ColoredHelp) + .color(ColorChoice::Auto) .subcommand( App::new("install") .about("Install the packages that have been mirrored from other machines") @@ -63,7 +62,7 @@ fn safe_main() -> Result<()> { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ColorChoice::Auto, + LogColorChoice::Auto, ) .context("no interactive terminal")?; diff --git a/src/package.rs b/src/package.rs index 4e9f604a0..0ce8afe30 100644 --- a/src/package.rs +++ b/src/package.rs @@ -89,7 +89,7 @@ impl Package { /// Check if this package is already installed. pub fn is_installed(&self) -> Result { - self.source.package_is_installed(&self) + self.source.package_is_installed(self) } /// Check if the package manager can be found. diff --git a/src/package_manager_impl.rs b/src/package_manager_impl.rs index 95db8609a..04f98d9b2 100644 --- a/src/package_manager_impl.rs +++ b/src/package_manager_impl.rs @@ -130,7 +130,7 @@ impl PackageManager { // Loop over the arguments handling flags in a special way while let Some(arg) = args_iter.next() { // Stop when a flag is found that invalidate the command - if self.has_invalidating_flag(&arg) { + if self.has_invalidating_flag(arg) { return vec![]; } @@ -140,7 +140,7 @@ impl PackageManager { .expect("Arg string is suddenly zero bytes"); if first_char == '-' || first_char == '+' { - self.handle_capture_flags(&arg, &mut args_iter, &mut catched_flags); + self.handle_capture_flags(arg, &mut args_iter, &mut catched_flags); // If it's a flag containing an extra arguments besides it skip one if self.known_flags_with_values().contains(&arg) { @@ -195,8 +195,7 @@ impl PackageManager { fn has_invalidating_flag(self, arg: &str) -> bool { self.invalidating_flags() .iter() - .find(|capture| *capture == &arg) - .is_some() + .any(|capture| capture == &arg) } /// Handle the iterator's flags using the different options as defined in the package managers. diff --git a/src/repo.rs b/src/repo.rs index c965f02d7..433a8ea00 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -160,8 +160,6 @@ impl Repo { } fn pretty_config() -> PrettyConfig { - PrettyConfig::new() - .with_depth_limit(2) - .with_indentor("".into()) + PrettyConfig::new().depth_limit(2).indentor("".into()) } }