From 2f72fb627d1ad3256b12e928b327a4a6a0cd97cb Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Sat, 15 Jun 2024 07:18:30 +0200 Subject: [PATCH] chore: bump to rust 1.79 --- Cargo.toml | 4 ++-- Dockerfile | 4 ++-- adana-db/src/file_db.rs | 18 ++++-------------- adana-shell/src/editor.rs | 6 +----- rust-toolchain.toml | 2 +- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5532e4a..a275b7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ description = "namespaces aliases for command lines & basic scripting language" homepage = "https://github.com/nbittich/adana" repository = "https://github.com/nbittich/adana" readme = "README.md" -rust-version = "1.78" +rust-version = "1.79" edition = "2021" license = "MIT" exclude = ["vscode/", "dist/", ".vscode", ".history", ".git", ".github"] @@ -39,7 +39,7 @@ strum = { version = "0.26.2", features = ["derive"] } ctrlc = "3.4.4" env_logger = { version = "0.11.3", default-features = false } arboard = "3.4.0" -regex = { version = "1.10.4", default-features = false, features = ["std"] } +regex = { version = "1.10.5", default-features = false, features = ["std"] } serial_test = "3.1.1" # wasm diff --git a/Dockerfile b/Dockerfile index b5c33fd..f04351c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.78-bookworm as builder +FROM rust:1.79-bookworm as builder WORKDIR /app @@ -10,7 +10,7 @@ COPY . . RUN cargo build --release -FROM rust:1.78-slim-bookworm +FROM rust:1.79-slim-bookworm ENV RUST_LOG=info diff --git a/adana-db/src/file_db.rs b/adana-db/src/file_db.rs index 28f3013..713daff 100644 --- a/adana-db/src/file_db.rs +++ b/adana-db/src/file_db.rs @@ -99,23 +99,13 @@ where } fn drop_tree(&mut self, tree_name: &str) -> bool { - if let Some(res) = - self.update(|mut guard| Some(guard.drop_tree(tree_name))) - { - res - } else { - false - } + self.update(|mut guard| Some(guard.drop_tree(tree_name))) + .unwrap_or_default() } fn clear_tree(&mut self, tree_name: &str) -> bool { - if let Some(res) = - self.update(|mut guard| Some(guard.clear_tree(tree_name))) - { - res - } else { - false - } + self.update(|mut guard| Some(guard.clear_tree(tree_name))) + .unwrap_or_default() } fn merge_trees( diff --git a/adana-shell/src/editor.rs b/adana-shell/src/editor.rs index fcde8c3..2e69714 100644 --- a/adana-shell/src/editor.rs +++ b/adana-shell/src/editor.rs @@ -100,11 +100,7 @@ pub fn read_line( } else { let shorter_path = { // we try to keep only the last part of the path - if let Some(path) = path.split(MAIN_SEPARATOR).last() { - path - } else { - "" - } + path.split(MAIN_SEPARATOR).last().unwrap_or_default() }; if real_w > curr_cache.len() + branch.len() + shorter_path.len() { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 744175d..c6e4d7d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.78" +channel = "1.79"