Last 12 weeks · 4 commits
2 of 6 standards met
Closes #176 (docs direction per the maintainer's comment: "This can just be added as new documentation"). Background 's section only exemplified the end-bound case (). The symmetric start-bound case is reachable the same way: a custom impl returning from hits in and panics with (src/util/search.rs:380). Change (docs-only) The section of now also documents the start-bound case, notes that range syntax cannot produce such a bound but any custom implementation can, and that it is not specially handled. An inline comment asking "Can this case ever happen?" is thereby answered by the docs as well. No code behavior is changed; matching the maintainer's chosen resolution for #176. (#175's already has a section on master, so no change was needed there.) Verification on the crate with this change applied: 102 passed / 0 failed / 5 ignored
Closes #187. declined the packed prefilter outright (), so caseless searches ran the automaton unaccelerated. The ASCII case bit (0x20) lives in a byte's high nibble, so a caseless pattern shares its low-nibble mask entry with its other case and only the high-nibble entry widens. Same instruction sequence at search time, no runtime cost. The change is: — mask builders also add for ASCII letters, in both the slim and fat paths. — candidate verification case-folds. — the short-haystack fallback folds in its hash and its verifier, so it agrees with the masks. — , threaded to . — removes the two case-insensitive bail-outs. Non-letters still compare exactly. /` `[{]}^~_packed/tests.rspacked/teddy/README.md` already describes.
currently disables the packed prefilter (), so caseless searches run the automaton unaccelerated. Patch enables it. The ASCII case bit (0x20) lives in a byte's high nibble, so a caseless pattern shares its low-nibble mask entry with its other case and only the high-nibble entry widens — same instruction sequence, no runtime cost. Candidate verification case-folds to match. Non-letters still compare exactly: /` `[{^~ascii_case_insensitive(true)packed::Config::ascii_case_insensitive(bool)packed/teddy/README.md`. ~160 lines across 5 files plus tests. PR follows.
Commit 0f3f5da ("api: document a couple panicking preconditions") documented the overflow panic of and made it explicit via , but kept the unchecked additions. Consequently, with debug assertions enabled it panics with the generic "attempt to add with overflow" message rather than the documented one, and in release builds it silently produces a wrapped, nonsensical span instead of panicking: This PR delegates to and documents the panic in the same style. Test suite passes. Found by running Kani's autoharness (model-checking/kani#3832) over aho-corasick 1.1.4, where both methods were reported; is already fixed on main, so only remained.
Repository: BurntSushi/aho-corasick. Description: A fast implementation of Aho-Corasick in Rust. Stars: 1291, Forks: 121. Primary language: Rust. Languages: Rust (100%). License: Unlicense. Topics: aho-corasick, finite-state-machine, search, substring-matching, text-processing. Open PRs: 12, open issues: 9. Last activity: 1mo ago. Community health: 42%. Top contributors: BurntSushi, andrew-d, Marwes, atouchet, GuillaumeGomez, jneem, ruuda, Ten0, adetaylor, allaboutevemirolive and others.