(buf: &[u8])
| 233 | } |
| 234 | |
| 235 | fn parse_simple_string(buf: &[u8]) -> io::Result<Option<(String, usize)>> { |
| 236 | match find_crlf(buf) { |
| 237 | Some(pos) => { |
| 238 | let s = String::from_utf8_lossy(&buf[..pos]).into_owned(); |
| 239 | Ok(Some((s, pos + 2))) |
| 240 | } |
| 241 | None => Ok(None), |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | fn parse_integer(buf: &[u8]) -> io::Result<Option<(i64, usize)>> { |
| 246 | match find_crlf(buf) { |
no test coverage detected