diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index b20d9378..44375c06 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -42,14 +42,14 @@ pub async fn register( map.insert("email", email); map.insert("password", password); - let url = format!("{}/user/{}", address, username); + let url = format!("{address}/user/{username}"); let resp = reqwest::get(url).await?; if resp.status().is_success() { bail!("username already in use"); } - let url = format!("{}/register", address); + let url = format!("{address}/register"); let client = reqwest::Client::new(); let resp = client .post(url) @@ -68,7 +68,7 @@ pub async fn register( } pub async fn login(address: &str, req: LoginRequest) -> Result { - let url = format!("{}/login", address); + let url = format!("{address}/login"); let client = reqwest::Client::new(); let resp = client @@ -111,7 +111,7 @@ pub async fn latest_version() -> Result { impl<'a> Client<'a> { pub fn new(sync_addr: &'a str, session_token: &'a str, key: String) -> Result { let mut headers = HeaderMap::new(); - headers.insert(AUTHORIZATION, format!("Token {}", session_token).parse()?); + headers.insert(AUTHORIZATION, format!("Token {session_token}").parse()?); Ok(Client { sync_addr, diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs index 874c4407..d0e696c4 100644 --- a/atuin-client/src/database.rs +++ b/atuin-client/src/database.rs @@ -448,7 +448,7 @@ impl Database for Sqlite { } else if let Some(term) = query_part.strip_prefix('\'') { format!("{glob}{term}{glob}") } else if is_inverse { - format!("{glob}{term}{glob}", term = query_part) + format!("{glob}{query_part}{glob}") } else { query_part.split("").join(glob) }; diff --git a/atuin-client/src/import/fish.rs b/atuin-client/src/import/fish.rs index 84f4a2f1..850814c7 100644 --- a/atuin-client/src/import/fish.rs +++ b/atuin-client/src/import/fish.rs @@ -31,7 +31,7 @@ fn default_histpath() -> Result { }; let mut histpath = data.join("fish"); - histpath.push(format!("{}_history", session)); + histpath.push(format!("{session}_history")); if histpath.exists() { Ok(histpath) diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 379237c6..3cefe1cb 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -262,9 +262,8 @@ impl Settings { let data_dir = atuin_common::utils::data_dir(); create_dir_all(&config_dir) - .wrap_err_with(|| format!("could not create dir {:?}", config_dir))?; - create_dir_all(&data_dir) - .wrap_err_with(|| format!("could not create dir {:?}", data_dir))?; + .wrap_err_with(|| format!("could not create dir {config_dir:?}"))?; + create_dir_all(&data_dir).wrap_err_with(|| format!("could not create dir {data_dir:?}"))?; let mut config_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") { PathBuf::from(p) diff --git a/src/command/client/history.rs b/src/command/client/history.rs index 145fe63a..34b851d9 100644 --- a/src/command/client/history.rs +++ b/src/command/client/history.rs @@ -257,8 +257,7 @@ impl Cmd { } (Some(session), Some(cwd)) => { let query = format!( - "select * from history where cwd = '{}' and session = '{}';", - cwd, session + "select * from history where cwd = '{cwd}' and session = '{session}';", ); db.query_history(&query).await? }