Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenByteDev committed Dec 9, 2022
1 parent 9f48ff7 commit a84dc00
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions burnt-sushi-blocker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ futures = { version = "0.3.25", default-features = false }
tokio = { version = "1.23.0", features = ["net", "rt", "macros", "sync"], default-features = false }
tokio-util = { version = "0.7.4", features = ["compat"], default-features = false }
winapi = { version = "0.3.9", features = ["ws2tcpip", "rpc"], default-features = false }
# detour = { version = "0.8.1", features = ["nightly"], default-features = false }
detour = { git = "https://github.com/Hpmason/detour-rs.git", branch = "fix-nightly1.67.0-changes", commit = "0773585c9d4940fe6dd104076a46e8e11495080e", features = ["nightly"], default-features = false }
detour = { git = "https://github.com/Hpmason/detour-rs.git", branch = "fix-nightly1.67.0-changes", features = ["nightly"], default-features = false }
shared = { path = "../shared", default-features = false }
regex = { version = "1.7.0", default-features = false }
enum-map = { version = "2.4.1", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions burnt-sushi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn build_crate(name: &str, target: &str, file: &str) -> PathBuf {
crate_dir.push(name);
cargo_emit::rerun_if_changed!("..\\{}", name);

let mut command = Command::new(&cargo_exe);
let mut command = Command::new(cargo_exe);

if cfg!(nightly) {
command.arg("+nightly");
Expand All @@ -66,7 +66,7 @@ fn build_crate(name: &str, target: &str, file: &str) -> PathBuf {
crate_artifact.push(if is_release { "release" } else { "debug" });
crate_artifact.push(file);

assert!(crate_artifact.exists(), "{:?}", crate_artifact);
assert!(crate_artifact.exists(), "{crate_artifact:?}");

crate_artifact
}
4 changes: 2 additions & 2 deletions burnt-sushi/src/logger/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ impl Console {
pub fn println(&self, s: impl Display) -> io::Result<()> {
match &self.0 {
ConsoleImpl::None => {}
ConsoleImpl::Attach | ConsoleImpl::Alloc => println!("{}", s),
ConsoleImpl::Piped { pipe, .. } => writeln!(pipe.lock().unwrap(), "{}", s)?,
ConsoleImpl::Attach | ConsoleImpl::Alloc => println!("{s}"),
ConsoleImpl::Piped { pipe, .. } => writeln!(pipe.lock().unwrap(), "{s}")?,
}
Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions burnt-sushi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async fn main() {
if ARGS.install {
match handle_install().await {
Ok(()) => info!("App successfully installed."),
Err(e) => error!("Failed to install application: {}", e),
Err(e) => error!("Failed to install application: {e}"),
}
return;
}
Expand All @@ -80,7 +80,7 @@ async fn main() {
match terminate_other_instances() {
Ok(_) => debug!("Killed previously running instances"),
Err(err) => {
error!("Failed to open previously running instance (err={})", err);
error!("Failed to open previously running instance (err={err})");
return;
}
}
Expand All @@ -89,7 +89,7 @@ async fn main() {
if ARGS.ignore_singleton {
run().await;
} else {
let lock = NamedMutex::new(&format!("{} SINGLETON MUTEX", APP_NAME)).unwrap();
let lock = NamedMutex::new(&format!("{APP_NAME} SINGLETON MUTEX")).unwrap();

let mut guard_result = lock.try_lock();

Expand Down Expand Up @@ -125,7 +125,7 @@ async fn run() {
match update::update().await {
Ok(true) => update_restart_tx.send(()).unwrap(),
Ok(false) => {}
Err(e) => error!("App update failed: {:#}", e),
Err(e) => error!("App update failed: {e:#}"),
}
});

Expand Down
6 changes: 2 additions & 4 deletions burnt-sushi/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{
};

use anyhow::Context;
use lenient_semver;
use log::{debug, error, info};
use reqwest::header::HeaderValue;
use self_update::update::Release;
Expand Down Expand Up @@ -68,8 +67,7 @@ pub async fn update() -> anyhow::Result<bool> {
let asset = release
.assets
.into_iter()
.filter(|asset| asset.name.ends_with(".exe"))
.next()
.find(|asset| asset.name.ends_with(".exe"))
.context("No release executable asset found")?;

debug!(
Expand Down Expand Up @@ -185,7 +183,7 @@ async fn confirm_update(version: &str) -> bool {
let mut toast = Toast::new();
toast
.text1("BurntSushi")
.text2(Text::new(format!("Update app to to {}?", version)))
.text2(Text::new(format!("Update app to to {version}?")))
.action(Action::new("Update", CONFIRM_ACTION, CONFIRM_ACTION))
.action(Action::new("Ignore", IGNORE_ACTION, IGNORE_ACTION));

Expand Down

0 comments on commit a84dc00

Please sign in to comment.