mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-22 08:13:57 +01:00
lints
This commit is contained in:
parent
7b30466f45
commit
a40e41caff
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -76,7 +76,7 @@ dependencies = [
|
||||
"atuin-client",
|
||||
"atuin-common",
|
||||
"atuin-server",
|
||||
"base64 0.21.0",
|
||||
"base64 0.20.0",
|
||||
"bitflags",
|
||||
"cassowary",
|
||||
"chrono",
|
||||
@ -244,12 +244,6 @@ version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
||||
|
||||
[[package]]
|
||||
name = "beef"
|
||||
version = "0.5.2"
|
||||
|
@ -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"
|
||||
|
@ -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<LoginResponse> {
|
||||
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<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,
|
||||
|
@ -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)
|
||||
};
|
||||
|
@ -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)
|
||||
|
@ -221,7 +221,7 @@ mod test {
|
||||
println!("h: {:#?}", histdb.histdb);
|
||||
println!("counter: {:?}", histdb.histdb.len());
|
||||
for i in histdb.histdb {
|
||||
println!("{:?}", i);
|
||||
println!("{i:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user