diff --git a/README.md b/README.md index c505dbb..fbd8c82 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ Full documentation: [helixnotes.com/docs](https://helixnotes.com/docs.html) ### Prerequisites -- [Rust](https://rustup.rs/) (1.77+) +- [Rust](https://rustup.rs/) (1.88+) - [Node.js](https://nodejs.org/) (18+) - [pnpm](https://pnpm.io/) - System dependencies for Tauri: see [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index cc61f78..a9ba701 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -5,7 +5,11 @@ description = "Local markdown note-taking app" authors = ["HelixNotes"] license = "AGPL-3.0-or-later" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.88" + +[lints.clippy] +# This style lint is version-dependent and produces over 100 legacy-only diagnostics on Rust 1.88. +uninlined_format_args = "allow" [lib] name = "app_lib" diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 599e4aa..cbcfe62 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1691,7 +1691,7 @@ pub fn get_vault_stats(state: State<'_, AppState>) -> Result .filter(|p| { // attachments under .helixnotes count; nothing else in .helixnotes or .trash does let s = p.to_string_lossy(); - !(s.contains("/.helixnotes/") && !s.contains("/.helixnotes/attachments/")) + (!s.contains("/.helixnotes/") || s.contains("/.helixnotes/attachments/")) && !s.contains("/.trash/") }) .collect(); diff --git a/src-tauri/src/image_proxy.rs b/src-tauri/src/image_proxy.rs index 0f2cef3..c38cc1f 100644 --- a/src-tauri/src/image_proxy.rs +++ b/src-tauri/src/image_proxy.rs @@ -141,11 +141,12 @@ fn image_client(host: &str, addresses: &[SocketAddr]) -> Result normalized_host(host) != redirect_host, + None => true, + }; if attempt.previous().len() >= 5 - || attempt - .url() - .host_str() - .map_or(true, |host| normalized_host(host) != redirect_host) + || redirected_elsewhere || validate_url(attempt.url().as_str()).is_err() { attempt.stop() diff --git a/src-tauri/src/sync.rs b/src-tauri/src/sync.rs index f830ed4..2855f47 100644 --- a/src-tauri/src/sync.rs +++ b/src-tauri/src/sync.rs @@ -528,8 +528,14 @@ fn apply_changes( match (l, r) { (Some(lf), Some(re)) => { - let local_changed = m.map_or(true, |me| me.local_hash != lf.hash); - let remote_changed = m.map_or(true, |me| &me.remote_etag != re); + let local_changed = match m { + Some(entry) => entry.local_hash != lf.hash, + None => true, + }; + let remote_changed = match m { + Some(entry) => &entry.remote_etag != re, + None => true, + }; if !local_changed && !remote_changed { new_m.files.insert( key.clone(), diff --git a/src-tauri/src/vault/import.rs b/src-tauri/src/vault/import.rs index 9f840ec..a9b41a8 100644 --- a/src-tauri/src/vault/import.rs +++ b/src-tauri/src/vault/import.rs @@ -251,10 +251,8 @@ fn rename_deprecated_properties(raw: &str) -> String { mapping.insert(new_key, val); renamed = true; } - } else { - if mapping.remove(&old_key).is_some() { - renamed = true; - } + } else if mapping.remove(&old_key).is_some() { + renamed = true; } }