diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e6313..9724517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project follows [Semantic Versioning](https://semver.org/). - Bump `cfg-if` to 1.x - macOS backend now uses `objc2` / `objc2-app-kit` instead of `cocoa` / `objc` - `Checker::check` now takes `&self` instead of `&mut self` +- Bump to Edition 2024 / MSRV 1.85. ### Fixed - Pass null-terminated dictionary paths to Hunspell on Linux (stops spurious diff --git a/Cargo.toml b/Cargo.toml index fdfc6a2..f289cf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,8 @@ authors = [ "Andy Russell ", "Robert Mongold " ] -edition = "2021" +edition = "2024" +rust-version = "1.85" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index bd8eaec..7a42a48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -96,7 +96,7 @@ impl Checker { } /// Check a text for spelling errors. Returns an iterator over the errors present in the text. - pub fn check<'a>(&self, text: &'a str) -> impl Iterator + 'a { + pub fn check<'a>(&self, text: &'a str) -> impl Iterator + 'a + use<'a> { self.0.check(text).map(SpellingError) } diff --git a/src/mac.rs b/src/mac.rs index ae85770..fb43b37 100644 --- a/src/mac.rs +++ b/src/mac.rs @@ -110,7 +110,7 @@ impl Checker { with_checker(|c| c.ignoreWord_inSpellDocumentWithTag(&ns_word, tag)); } - pub fn check(&self, text: &str) -> impl Iterator { + pub fn check(&self, text: &str) -> impl Iterator + use<> { SpellcheckIter { document_tag: self.document_tag, ns_text: ns_string(text), diff --git a/src/unix.rs b/src/unix.rs index 385eac6..4321253 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -95,7 +95,7 @@ impl Checker { } } - pub fn check<'a>(&self, text: &'a str) -> impl Iterator + 'a { + pub fn check<'a>(&self, text: &'a str) -> impl Iterator + 'a + use<'a> { let hunspell = self.hunspell; words(text).filter_map(move |(start, end, word)| { diff --git a/src/win.rs b/src/win.rs index 5ad9ebd..7c05387 100644 --- a/src/win.rs +++ b/src/win.rs @@ -5,7 +5,6 @@ use std::iter; use std::os::windows::ffi::OsStrExt; use windows::{ - core::{HSTRING, PWSTR}, Win32::{ Foundation::S_FALSE, Globalization::{ @@ -13,10 +12,11 @@ use windows::{ SpellCheckerFactory, }, System::Com::{ - CoCreateInstance, CoInitializeEx, CoTaskMemFree, CLSCTX_INPROC_SERVER, - COINIT_MULTITHREADED, + CLSCTX_INPROC_SERVER, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, + CoTaskMemFree, }, }, + core::{HSTRING, PWSTR}, }; fn wide_string(s: &str) -> Vec { @@ -94,7 +94,7 @@ impl Checker { out } - pub fn check(&self, text: &str) -> impl Iterator { + pub fn check(&self, text: &str) -> impl Iterator + use<> { if text.is_empty() { return ErrorIter { original: String::new(),