diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b1992..42ef7dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Changed +- Document locale and threading caveats in the README +- Drop obsolete `unexpected_cfgs` lint (no longer needed after objc2) + ## [0.2.1] - 2026-08-07 ### Added diff --git a/Cargo.toml b/Cargo.toml index 4d7102b..7d00c13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,3 @@ hunspell-sys = "0.3.1" [dependencies] cfg-if = "1.0.4" - -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("cargo-clippy"))'] } diff --git a/README.md b/README.md index 1ccc4db..3a73e4d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This is a **maintained fork** of [euclio/spellbound](https://github.com/euclio/s use spellbound::Checker; fn main() -> Result<(), spellbound::Error> { - let mut checker = Checker::new()?; + let checker = Checker::new()?; // Or: Checker::with_locale("en-US")?; for err in checker.check("I beleeve I can fly") { @@ -36,7 +36,17 @@ fn main() -> Result<(), spellbound::Error> { } ``` -Checker::new() defaults to English (en_US /en_GB on Linux, en-US on Windows). Use with_locale for another language. Locales may be written as en_US or en-US. +`Checker::new()` defaults to English (`en_US` / `en_GB` on Linux, `en-US` on Windows). Use `with_locale` for another language. Locales may be written as `en_US` or `en-US`. + +Unknown or unsupported locales behave differently by platform: + +- **Linux:** missing dictionary / unknown locale → `Error::Unavailable` +- **macOS:** empty locale → `Error::Unavailable`; unknown tags may still create a checker (system fallback) +- **Windows:** unsupported language tag → `Error::Unavailable` + +## Threading + +macOS serializes access to the shared `NSSpellChecker`. Do not assume `Checker` is `Send` / `Sync` across platforms. ## Linux