mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-16 18:32:05 +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-client",
|
||||||
"atuin-common",
|
"atuin-common",
|
||||||
"atuin-server",
|
"atuin-server",
|
||||||
"base64 0.21.0",
|
"base64 0.20.0",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cassowary",
|
"cassowary",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -244,12 +244,6 @@ version = "0.20.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
|
checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "base64"
|
|
||||||
version = "0.21.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "beef"
|
name = "beef"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
@ -63,7 +63,7 @@ tokio = { version = "1", features = ["full"] }
|
|||||||
async-trait = "0.1.58"
|
async-trait = "0.1.58"
|
||||||
interim = { version = "0.1.0", features = ["chrono"] }
|
interim = { version = "0.1.0", features = ["chrono"] }
|
||||||
cli-table = { version = "0.4", default-features = false }
|
cli-table = { version = "0.4", default-features = false }
|
||||||
base64 = "0.21.0"
|
base64 = "0.20.0"
|
||||||
crossbeam-channel = "0.5.1"
|
crossbeam-channel = "0.5.1"
|
||||||
clap = { version = "4.0.18", features = ["derive"] }
|
clap = { version = "4.0.18", features = ["derive"] }
|
||||||
clap_complete = "4.0.3"
|
clap_complete = "4.0.3"
|
||||||
|
@ -42,14 +42,14 @@ pub async fn register(
|
|||||||
map.insert("email", email);
|
map.insert("email", email);
|
||||||
map.insert("password", password);
|
map.insert("password", password);
|
||||||
|
|
||||||
let url = format!("{}/user/{}", address, username);
|
let url = format!("{address}/user/{username}");
|
||||||
let resp = reqwest::get(url).await?;
|
let resp = reqwest::get(url).await?;
|
||||||
|
|
||||||
if resp.status().is_success() {
|
if resp.status().is_success() {
|
||||||
bail!("username already in use");
|
bail!("username already in use");
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = format!("{}/register", address);
|
let url = format!("{address}/register");
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let resp = client
|
let resp = client
|
||||||
.post(url)
|
.post(url)
|
||||||
@ -68,7 +68,7 @@ pub async fn register(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn login(address: &str, req: LoginRequest) -> Result<LoginResponse> {
|
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 client = reqwest::Client::new();
|
||||||
|
|
||||||
let resp = client
|
let resp = client
|
||||||
@ -111,7 +111,7 @@ pub async fn latest_version() -> Result<Version> {
|
|||||||
impl<'a> Client<'a> {
|
impl<'a> Client<'a> {
|
||||||
pub fn new(sync_addr: &'a str, session_token: &'a str, key: String) -> Result<Self> {
|
pub fn new(sync_addr: &'a str, session_token: &'a str, key: String) -> Result<Self> {
|
||||||
let mut headers = HeaderMap::new();
|
let mut headers = HeaderMap::new();
|
||||||
headers.insert(AUTHORIZATION, format!("Token {}", session_token).parse()?);
|
headers.insert(AUTHORIZATION, format!("Token {session_token}").parse()?);
|
||||||
|
|
||||||
Ok(Client {
|
Ok(Client {
|
||||||
sync_addr,
|
sync_addr,
|
||||||
|
@ -448,7 +448,8 @@ impl Database for Sqlite {
|
|||||||
} else if let Some(term) = query_part.strip_prefix('\'') {
|
} else if let Some(term) = query_part.strip_prefix('\'') {
|
||||||
format!("{glob}{term}{glob}")
|
format!("{glob}{term}{glob}")
|
||||||
} else if is_inverse {
|
} else if is_inverse {
|
||||||
format!("{glob}{term}{glob}", term = query_part)
|
let term = query_part;
|
||||||
|
format!("{glob}{term}{glob}")
|
||||||
} else {
|
} else {
|
||||||
query_part.split("").join(glob)
|
query_part.split("").join(glob)
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ fn default_histpath() -> Result<PathBuf> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut histpath = data.join("fish");
|
let mut histpath = data.join("fish");
|
||||||
histpath.push(format!("{}_history", session));
|
histpath.push(format!("{session}_history"));
|
||||||
|
|
||||||
if histpath.exists() {
|
if histpath.exists() {
|
||||||
Ok(histpath)
|
Ok(histpath)
|
||||||
|
@ -221,7 +221,7 @@ mod test {
|
|||||||
println!("h: {:#?}", histdb.histdb);
|
println!("h: {:#?}", histdb.histdb);
|
||||||
println!("counter: {:?}", histdb.histdb.len());
|
println!("counter: {:?}", histdb.histdb.len());
|
||||||
for i in histdb.histdb {
|
for i in histdb.histdb {
|
||||||
println!("{:?}", i);
|
println!("{i:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,9 +262,8 @@ impl Settings {
|
|||||||
let data_dir = atuin_common::utils::data_dir();
|
let data_dir = atuin_common::utils::data_dir();
|
||||||
|
|
||||||
create_dir_all(&config_dir)
|
create_dir_all(&config_dir)
|
||||||
.wrap_err_with(|| format!("could not create dir {:?}", config_dir))?;
|
.wrap_err_with(|| format!("could not create dir {config_dir:?}"))?;
|
||||||
create_dir_all(&data_dir)
|
create_dir_all(&data_dir).wrap_err_with(|| format!("could not create dir {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") {
|
let mut config_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") {
|
||||||
PathBuf::from(p)
|
PathBuf::from(p)
|
||||||
|
@ -257,8 +257,7 @@ impl Cmd {
|
|||||||
}
|
}
|
||||||
(Some(session), Some(cwd)) => {
|
(Some(session), Some(cwd)) => {
|
||||||
let query = format!(
|
let query = format!(
|
||||||
"select * from history where cwd = '{}' and session = '{}';",
|
"select * from history where cwd = '{cwd}' and session = '{session}';"
|
||||||
cwd, session
|
|
||||||
);
|
);
|
||||||
db.query_history(&query).await?
|
db.query_history(&query).await?
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user