https://github.com/connorkuehl/subsl
Adds fun new features to Rust slices
https://github.com/connorkuehl/subsl
Last synced: 21 days ago
JSON representation
Adds fun new features to Rust slices
- Host: GitHub
- URL: https://github.com/connorkuehl/subsl
- Owner: connorkuehl
- License: apache-2.0
- Created: 2021-08-05T20:53:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-06T14:30:22.000Z (over 3 years ago)
- Last Synced: 2025-03-28T08:15:19.455Z (about 1 month ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# subsl
subsl extends the slices you know and love with some additional
functionality.For example, usually, you can't split a byte slice on a subslice;
with subsl, you can!## Examples
```rust
use subsl::Splitter;let http_get: &[u8] = &*b"GET / HTTP/1.0\r\n\r\nsome data in the body";
let sep = b"\r\n\r\n";
let mut iter = http_get.subsl_split(sep);
let headers = iter.next().unwrap();
let body = iter.next().unwrap();assert_eq!(headers, b"GET / HTTP/1.0");
assert_eq!(body, b"some data in the body");
```License: Apache-2.0