Crates.io | jetscii |
lib.rs | jetscii |
version | 0.5.3 |
source | src |
created_at | 2015-05-08 00:55:28.861601 |
updated_at | 2022-07-07 01:47:46.975416 |
description | A tiny library to efficiently search strings and byte slices for sets of ASCII characters or bytes. |
homepage | |
repository | https://github.com/shepmaster/jetscii |
max_upload_size | |
id | 2050 |
size | 73,296 |
A tiny library to efficiently search strings for sets of ASCII characters or byte slices for sets of bytes.
#[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));
}
#[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.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)