aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2025-03-09 22:27:38 +0000
committerGitHub <noreply@github.com>2025-03-09 22:27:38 +0000
commit231d87c47ee2aebcb1cb85aad261e1d762e83da0 (patch)
treeb64046391f7cc43fa8f4d767061e208421b1c198
parentfix: don't save empty commands (#2605) (diff)
downloadatuin-231d87c47ee2aebcb1cb85aad261e1d762e83da0.zip
chore: update rust toolchain to 1.85 (#2618)
* chore: update rust toolchain to 1.85 * nix things * make clippy happy I've replaced a bunch of &Option<String> with Option<String>. They were not in hot loops, so a single clone is really no big deal + keeps things simpler. * fmt
-rw-r--r--Cargo.toml2
-rw-r--r--crates/atuin-common/src/utils.rs2
-rw-r--r--crates/atuin-server/src/handlers/mod.rs4
-rw-r--r--crates/atuin/src/command/client/account/change_password.rs6
-rw-r--r--crates/atuin/src/command/client/account/login.rs11
-rw-r--r--crates/atuin/src/command/client/account/register.rs8
-rw-r--r--crates/atuin/src/command/client/import.rs2
-rw-r--r--crates/atuin/src/command/client/search/history_list.rs2
-rw-r--r--crates/atuin/src/sync.rs4
-rw-r--r--flake.nix2
-rw-r--r--rust-toolchain.toml2
11 files changed, 24 insertions, 21 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7ae91ee9..6d9e5f83 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,7 @@ exclude = ["ui/backend"]
[workspace.package]
version = "18.4.0"
authors = ["Ellie Huxtable <ellie@atuin.sh>"]
-rust-version = "1.82"
+rust-version = "1.85"
license = "MIT"
homepage = "https://atuin.sh"
repository = "https://github.com/atuinsh/atuin"
diff --git a/crates/atuin-common/src/utils.rs b/crates/atuin-common/src/utils.rs
index 7f156d77..fbf2ef82 100644
--- a/crates/atuin-common/src/utils.rs
+++ b/crates/atuin-common/src/utils.rs
@@ -146,7 +146,7 @@ pub trait Escapable: AsRef<str> {
} else {
let mut remaining = self.as_ref();
// Not a perfect way to reserve space but should reduce the allocations
- let mut buf = String::with_capacity(remaining.as_bytes().len());
+ let mut buf = String::with_capacity(remaining.len());
while let Some(i) = remaining.find(|c: char| c.is_ascii_control()) {
// safe to index with `..i`, `i` and `i+1..` as part[i] is a single byte ascii char
buf.push_str(&remaining[..i]);
diff --git a/crates/atuin-server/src/handlers/mod.rs b/crates/atuin-server/src/handlers/mod.rs
index 97132c07..a0d7ccc7 100644
--- a/crates/atuin-server/src/handlers/mod.rs
+++ b/crates/atuin-server/src/handlers/mod.rs
@@ -33,7 +33,7 @@ pub async fn index<DB: Database>(state: State<AppState<DB>>) -> Json<IndexRespon
})
}
-impl<'a> IntoResponse for ErrorResponseStatus<'a> {
+impl IntoResponse for ErrorResponseStatus<'_> {
fn into_response(self) -> axum::response::Response {
(self.status, Json(self.error)).into_response()
}
@@ -57,7 +57,7 @@ impl<'a> RespExt<'a> for ErrorResponse<'a> {
}
}
- fn reply(reason: &'a str) -> ErrorResponse {
+ fn reply(reason: &'a str) -> ErrorResponse<'a> {
Self {
reason: reason.into(),
}
diff --git a/crates/atuin/src/command/client/account/change_password.rs b/crates/atuin/src/command/client/account/change_password.rs
index 97ebfa9c..6fee56be 100644
--- a/crates/atuin/src/command/client/account/change_password.rs
+++ b/crates/atuin/src/command/client/account/change_password.rs
@@ -15,14 +15,14 @@ pub struct Cmd {
impl Cmd {
pub async fn run(self, settings: &Settings) -> Result<()> {
- run(settings, &self.current_password, &self.new_password).await
+ run(settings, self.current_password, self.new_password).await
}
}
pub async fn run(
settings: &Settings,
- current_password: &Option<String>,
- new_password: &Option<String>,
+ current_password: Option<String>,
+ new_password: Option<String>,
) -> Result<()> {
let client = api_client::Client::new(
&settings.sync_address,
diff --git a/crates/atuin/src/command/client/account/login.rs b/crates/atuin/src/command/client/account/login.rs
index 57d5f863..3785470f 100644
--- a/crates/atuin/src/command/client/account/login.rs
+++ b/crates/atuin/src/command/client/account/login.rs
@@ -49,7 +49,7 @@ impl Cmd {
return Ok(());
}
- let username = or_user_input(&self.username, "username");
+ let username = or_user_input(self.username.clone(), "username");
let password = self.password.clone().unwrap_or_else(read_user_password);
let key_path = settings.key_path.as_str();
@@ -61,7 +61,10 @@ impl Cmd {
println!("Do not share this key with anyone");
println!("\nRead more here: https://docs.atuin.sh/guide/sync/#login \n");
- let key = or_user_input(&self.key, "encryption key [blank to use existing key file]");
+ let key = or_user_input(
+ self.key.clone(),
+ "encryption key [blank to use existing key file]",
+ );
// if provided, the key may be EITHER base64, or a bip mnemonic
// try to normalize on base64
@@ -152,8 +155,8 @@ impl Cmd {
}
}
-pub(super) fn or_user_input(value: &'_ Option<String>, name: &'static str) -> String {
- value.clone().unwrap_or_else(|| read_user_input(name))
+pub(super) fn or_user_input(value: Option<String>, name: &'static str) -> String {
+ value.unwrap_or_else(|| read_user_input(name))
}
pub(super) fn read_user_password() -> String {
diff --git a/crates/atuin/src/command/client/account/register.rs b/crates/atuin/src/command/client/account/register.rs
index f1479b0c..a62b8f0f 100644
--- a/crates/atuin/src/command/client/account/register.rs
+++ b/crates/atuin/src/command/client/account/register.rs
@@ -18,15 +18,15 @@ pub struct Cmd {
impl Cmd {
pub async fn run(self, settings: &Settings) -> Result<()> {
- run(settings, &self.username, &self.email, &self.password).await
+ run(settings, self.username, self.email, self.password).await
}
}
pub async fn run(
settings: &Settings,
- username: &Option<String>,
- email: &Option<String>,
- password: &Option<String>,
+ username: Option<String>,
+ email: Option<String>,
+ password: Option<String>,
) -> Result<()> {
use super::login::or_user_input;
println!("Registering for an Atuin Sync account");
diff --git a/crates/atuin/src/command/client/import.rs b/crates/atuin/src/command/client/import.rs
index d7857b9f..46343267 100644
--- a/crates/atuin/src/command/client/import.rs
+++ b/crates/atuin/src/command/client/import.rs
@@ -145,7 +145,7 @@ impl<'db, DB: Database> HistoryImporter<'db, DB> {
}
#[async_trait]
-impl<'db, DB: Database> Loader for HistoryImporter<'db, DB> {
+impl<DB: Database> Loader for HistoryImporter<'_, DB> {
async fn push(&mut self, hist: History) -> Result<()> {
self.pb.inc(1);
self.buf.push(hist);
diff --git a/crates/atuin/src/command/client/search/history_list.rs b/crates/atuin/src/command/client/search/history_list.rs
index 792e89b8..ccffc95c 100644
--- a/crates/atuin/src/command/client/search/history_list.rs
+++ b/crates/atuin/src/command/client/search/history_list.rs
@@ -48,7 +48,7 @@ impl ListState {
}
}
-impl<'a> StatefulWidget for HistoryList<'a> {
+impl StatefulWidget for HistoryList<'_> {
type State = ListState;
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
diff --git a/crates/atuin/src/sync.rs b/crates/atuin/src/sync.rs
index feca3026..343360b7 100644
--- a/crates/atuin/src/sync.rs
+++ b/crates/atuin/src/sync.rs
@@ -7,8 +7,8 @@ use atuin_client::{
};
use atuin_common::record::RecordId;
-/// This is the only crate that ties together all other crates.
-/// Therefore, it's the only crate where functions tying together all stores can live
+// This is the only crate that ties together all other crates.
+// Therefore, it's the only crate where functions tying together all stores can live
/// Rebuild all stores after a sync
/// Note: for history, this only does an _incremental_ sync. Hence the need to specify downloaded
diff --git a/flake.nix b/flake.nix
index 4c9383f0..ec6e7555 100644
--- a/flake.nix
+++ b/flake.nix
@@ -32,7 +32,7 @@
fenix.packages.${system}.fromToolchainFile
{
file = ./rust-toolchain.toml;
- sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
+ sha256 = "sha256-AJ6LX/Q/Er9kS15bn9iflkUwcgYqRQxiOIL2ToVAXaU=";
};
in
pkgs.makeRustPlatform {
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 76fcadb5..c5794a6b 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,2 +1,2 @@
[toolchain]
-channel = "1.82"
+channel = "1.85"