Download code/bugfind/bench/kernels/tinyhttp_hdr/post/src/lib.rs from viai957/align: direct link, hf CLI and curl.
- Browser
- Download file 329 Bytes
-
https://huggingface.co/viai957/align/resolve/main/code/bugfind/bench/kernels/tinyhttp_hdr/post/src/lib.rs
- Command line
-
hf download hf://viai957/align/code/bugfind/bench/kernels/tinyhttp_hdr/post/src/lib.rs
-
curl -L -o lib.rs https://huggingface.co/viai957/align/resolve/main/code/bugfind/bench/kernels/tinyhttp_hdr/post/src/lib.rs
329 Bytes
| fn is_ws(b: u8) -> bool { | |
| b == b' ' || b == b'\t' || b == b'\n' || b == b'\r' || b == 11u8 || b == 12u8 | |
| } | |
| pub fn header_field_ok(s: &[u8]) -> bool { | |
| let mut ok = true; | |
| let mut i = 0usize; | |
| while i < s.len() { | |
| if s[i] >= 128 || is_ws(s[i]) { | |
| ok = false; | |
| } | |
| i += 1; | |
| } | |
| ok | |
| } | |