13 releases
Uses old Rust 2015
0.5.3 | Jul 7, 2022 |
---|---|
0.5.1 | Sep 18, 2021 |
0.5.0 | May 6, 2021 |
0.4.4 | Jun 10, 2019 |
0.3.1 | Jul 29, 2015 |
#193 in Text processing
17,024 downloads per month
Used in 53 crates
(14 directly)
57KB
1.5K
SLoC
Jetscii
A tiny library to efficiently search strings for sets of ASCII characters or byte slices for sets of bytes.
Examples
Searching for a set of ASCII characters
#[macro_use]
extern crate jetscii;
fn main() {
let part_number = "86-J52:rev1";
let first = ascii_chars!('-', ':').find(part_number);
assert_eq!(first, Some(2));
}
Searching for a set of bytes
#[macro_use]
extern crate jetscii;
fn main() {
let raw_data = [0x00, 0x01, 0x10, 0xFF, 0x42];
let first = bytes!(0x01, 0x10).find(&raw_data);
assert_eq!(first, Some(1));
}
Check out the documentation for information about feature flags and benchmarks.
Contributing
- Fork it (https://github.com/shepmaster/jetscii/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Add a failing test.
- Add code to pass the test.
- Commit your changes (
git commit -am 'Add some feature'
) - Ensure tests pass.
- Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request