Address feedback from Niklas

This commit is contained in:
James Wilson
2021-08-11 16:59:11 +01:00
parent f089ad1758
commit f26b39ac63
15 changed files with 62 additions and 38 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ fn header_contains_value(
pub fn trim(x: &[u8]) -> &[u8] {
let from = match x.iter().position(|x| !x.is_ascii_whitespace()) {
Some(i) => i,
None => return &x[0..0],
None => return &[],
};
let to = x.iter().rposition(|x| !x.is_ascii_whitespace()).unwrap();
&x[from..=to]