style: satisfy current clippy lints
This commit is contained in:
@@ -37,12 +37,12 @@ fn spawn_codewhale(args: &[String]) -> std::io::Result<std::process::ExitStatus>
|
||||
// same directory as this shim but not on PATH (#2006).
|
||||
#[cfg(windows)]
|
||||
{
|
||||
if let Ok(exe_path) = env::current_exe() {
|
||||
if let Some(dir) = exe_path.parent() {
|
||||
let sibling = dir.join("codewhale.exe");
|
||||
if sibling.is_file() {
|
||||
return Command::new(sibling).args(args).status();
|
||||
}
|
||||
if let Ok(exe_path) = env::current_exe()
|
||||
&& let Some(dir) = exe_path.parent()
|
||||
{
|
||||
let sibling = dir.join("codewhale.exe");
|
||||
if sibling.is_file() {
|
||||
return Command::new(sibling).args(args).status();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ fn spawn_codewhale(args: &[String]) -> std::io::Result<std::process::ExitStatus>
|
||||
// same directory as this shim but not on PATH (#2006).
|
||||
#[cfg(windows)]
|
||||
{
|
||||
if let Ok(exe_path) = env::current_exe() {
|
||||
if let Some(dir) = exe_path.parent() {
|
||||
let sibling = dir.join("codewhale.exe");
|
||||
if sibling.is_file() {
|
||||
return Command::new(sibling).args(args).status();
|
||||
}
|
||||
if let Ok(exe_path) = env::current_exe()
|
||||
&& let Some(dir) = exe_path.parent()
|
||||
{
|
||||
let sibling = dir.join("codewhale.exe");
|
||||
if sibling.is_file() {
|
||||
return Command::new(sibling).args(args).status();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,9 +473,9 @@ pub fn set_config_value(app: &mut App, key: &str, value: &str, persist: bool) ->
|
||||
Err(err) => return CommandResult::error(format!("Failed to save: {err}")),
|
||||
}
|
||||
}
|
||||
return CommandResult::error(format!(
|
||||
"base_url must be saved with --save; client base URL is loaded from config on startup. Restart and re-open your session after saving."
|
||||
));
|
||||
return CommandResult::error(
|
||||
"base_url must be saved with --save; client base URL is loaded from config on startup. Restart and re-open your session after saving.",
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ fn log_directory() -> Option<PathBuf> {
|
||||
{
|
||||
return resolve(userprofile);
|
||||
}
|
||||
dirs::home_dir().and_then(|h| resolve(h))
|
||||
dirs::home_dir().and_then(resolve)
|
||||
}
|
||||
|
||||
fn log_file_name(date: &str, pid: u32) -> String {
|
||||
|
||||
Reference in New Issue
Block a user