pingora
pingora copied to clipboard
chore: replace hand-rolled ascii trim helpers with stabilized std methods
Both trim_ascii_start and trim_ascii were stabilized in Rust 1.80, and
the project MSRV is 1.84 - so we can drop the hand-rolled copies.
conditional_filter.rs had a local trim_ascii_start fn with a TODO
comment pointing at the stdlib method that was (then) unstable:
// TODO: use `trim_ascii_start` when it stabilizes
fn trim_ascii_start(mut bytes: &[u8]) -> &[u8] { ... }
compression/mod.rs had the same pattern inline with a comment:
// This is equivalent to slice.trim_ascii() which is unstable
while let [first, rest @ ..] = v { ... }
while let [rest @ .., last] = v { ... }
Both replaced with the one-liner stdlib calls. No behavior change, all existing tests pass.