chore: cargo +nightly clippy --fix -Z unstable-options

This commit is contained in:
Alexander Meißner
2021-06-18 15:34:46 +02:00
committed by Michael Vines
parent 3570b00560
commit 6514096a67
177 changed files with 1021 additions and 1021 deletions

View File

@@ -548,7 +548,7 @@ pub fn init(
init_or_update(config_file, true, false)?;
let path_modified = if !no_modify_path {
add_to_path(&config.active_release_bin_dir().to_str().unwrap())
add_to_path(config.active_release_bin_dir().to_str().unwrap())
} else {
false
};
@@ -613,10 +613,10 @@ pub fn info(config_file: &str, local_info_only: bool, eval: bool) -> Result<(),
return Ok(());
}
println_name_value("Configuration:", &config_file);
println_name_value("Configuration:", config_file);
println_name_value(
"Active release directory:",
&config.active_release_dir().to_str().unwrap_or("?"),
config.active_release_dir().to_str().unwrap_or("?"),
);
fn print_release_version(config: &Config) {
@@ -633,14 +633,14 @@ pub fn info(config_file: &str, local_info_only: bool, eval: bool) -> Result<(),
if let Some(explicit_release) = &config.explicit_release {
match explicit_release {
ExplicitRelease::Semver(release_semver) => {
println_name_value(&format!("{}Release version:", BULLET), &release_semver);
println_name_value(&format!("{}Release version:", BULLET), release_semver);
println_name_value(
&format!("{}Release URL:", BULLET),
&github_release_download_url(release_semver),
);
}
ExplicitRelease::Channel(release_channel) => {
println_name_value(&format!("{}Release channel:", BULLET), &release_channel);
println_name_value(&format!("{}Release channel:", BULLET), release_channel);
println_name_value(
&format!("{}Release URL:", BULLET),
&release_channel_download_url(release_channel),
@@ -659,7 +659,7 @@ pub fn info(config_file: &str, local_info_only: bool, eval: bool) -> Result<(),
Some(ref update_manifest) => {
println_name_value("Installed version:", "");
print_release_version(&config);
print_update_manifest(&update_manifest);
print_update_manifest(update_manifest);
}
None => {
println_name_value("Installed version:", "None");

View File

@@ -18,7 +18,7 @@ mod stop_process;
mod update_manifest;
pub fn is_semver(semver: &str) -> Result<(), String> {
match semver::Version::parse(&semver) {
match semver::Version::parse(semver) {
Ok(_) => Ok(()),
Err(err) => Err(format!("{:?}", err)),
}
@@ -60,10 +60,10 @@ pub fn explicit_release_of(
fn handle_init(matches: &ArgMatches<'_>, config_file: &str) -> Result<(), String> {
let json_rpc_url = matches.value_of("json_rpc_url").unwrap();
let update_manifest_pubkey = pubkey_of(&matches, "update_manifest_pubkey");
let update_manifest_pubkey = pubkey_of(matches, "update_manifest_pubkey");
let data_dir = matches.value_of("data_dir").unwrap();
let no_modify_path = matches.is_present("no_modify_path");
let explicit_release = explicit_release_of(&matches, "explicit_release");
let explicit_release = explicit_release_of(matches, "explicit_release");
if update_manifest_pubkey.is_none() && explicit_release.is_none() {
Err(format!(
@@ -98,7 +98,7 @@ pub fn main() -> Result<(), String> {
.global(true)
.help("Configuration file to use");
match *defaults::CONFIG_FILE {
Some(ref config_file) => arg.default_value(&config_file),
Some(ref config_file) => arg.default_value(config_file),
None => arg.required(true),
}
})
@@ -115,7 +115,7 @@ pub fn main() -> Result<(), String> {
.required(true)
.help("Directory to store install data");
match *defaults::DATA_DIR {
Some(ref data_dir) => arg.default_value(&data_dir),
Some(ref data_dir) => arg.default_value(data_dir),
None => arg,
}
})
@@ -181,7 +181,7 @@ pub fn main() -> Result<(), String> {
.required(true)
.help("Keypair file of the account that funds the deployment");
match *defaults::USER_KEYPAIR {
Some(ref config_file) => arg.default_value(&config_file),
Some(ref config_file) => arg.default_value(config_file),
None => arg,
}
})
@@ -242,7 +242,7 @@ pub fn main() -> Result<(), String> {
let config_file = matches.value_of("config_file").unwrap();
match matches.subcommand() {
("init", Some(matches)) => handle_init(&matches, &config_file),
("init", Some(matches)) => handle_init(matches, config_file),
("info", Some(matches)) => {
let local_info_only = matches.is_present("local_info_only");
let eval = matches.is_present("eval");
@@ -290,7 +290,7 @@ pub fn main_init() -> Result<(), String> {
.takes_value(true)
.help("Configuration file to use");
match *defaults::CONFIG_FILE {
Some(ref config_file) => arg.default_value(&config_file),
Some(ref config_file) => arg.default_value(config_file),
None => arg.required(true),
}
})
@@ -303,7 +303,7 @@ pub fn main_init() -> Result<(), String> {
.required(true)
.help("Directory to store install data");
match *defaults::DATA_DIR {
Some(ref data_dir) => arg.default_value(&data_dir),
Some(ref data_dir) => arg.default_value(data_dir),
None => arg,
}
})
@@ -342,5 +342,5 @@ pub fn main_init() -> Result<(), String> {
.get_matches();
let config_file = matches.value_of("config_file").unwrap();
handle_init(&matches, &config_file)
handle_init(&matches, config_file)
}