Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
conradludgate committed Jan 28, 2023
1 parent 7b30466 commit a40e41c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 20 deletions.
8 changes: 1 addition & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tokio = { version = "1", features = ["full"] }
async-trait = "0.1.58"
interim = { version = "0.1.0", features = ["chrono"] }
cli-table = { version = "0.4", default-features = false }
base64 = "0.21.0"
base64 = "0.20.0"
crossbeam-channel = "0.5.1"
clap = { version = "4.0.18", features = ["derive"] }
clap_complete = "4.0.3"
Expand Down
8 changes: 4 additions & 4 deletions atuin-client/src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -68,7 +68,7 @@ pub async fn register(
}

pub async fn login(address: &str, req: LoginRequest) -> Result<LoginResponse> {
let url = format!("{}/login", address);
let url = format!("{address}/login");
let client = reqwest::Client::new();

let resp = client
Expand Down Expand Up @@ -111,7 +111,7 @@ pub async fn latest_version() -> Result<Version> {
impl<'a> Client<'a> {
pub fn new(sync_addr: &'a str, session_token: &'a str, key: String) -> Result<Self> {
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,
Expand Down
3 changes: 2 additions & 1 deletion atuin-client/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ 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)
let term = query_part;
format!("{glob}{term}{glob}")
} else {
query_part.split("").join(glob)
};
Expand Down
2 changes: 1 addition & 1 deletion atuin-client/src/import/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn default_histpath() -> Result<PathBuf> {
};

let mut histpath = data.join("fish");
histpath.push(format!("{}_history", session));
histpath.push(format!("{session}_history"));

if histpath.exists() {
Ok(histpath)
Expand Down
2 changes: 1 addition & 1 deletion atuin-client/src/import/zsh_histdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ mod test {
println!("h: {:#?}", histdb.histdb);
println!("counter: {:?}", histdb.histdb.len());
for i in histdb.histdb {
println!("{:?}", i);
println!("{i:?}");
}
}
}
5 changes: 2 additions & 3 deletions atuin-client/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/command/client/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
}
Expand Down

0 comments on commit a40e41c

Please sign in to comment.