(input: &[u8])
| 213 | } |
| 214 | |
| 215 | fn array1_parser(input: &[u8]) -> IResult<&[u8], (Cmd<'_>, usize)> { |
| 216 | let mut taken = 0; |
| 217 | |
| 218 | let (rem, (ln, sz)) = line_parser(input)?; |
| 219 | |
| 220 | taken += sz; |
| 221 | |
| 222 | tag("*1")(ln)?; |
| 223 | |
| 224 | // What is the next value? That tells us if we should proceed now or not. |
| 225 | let (rem, (itype1, sz)) = type_parser(rem)?; |
| 226 | taken += sz; |
| 227 | |
| 228 | match itype1 { |
| 229 | IType::BulkString(b"INFO") => Ok((rem, (Cmd::Info, taken))), |
| 230 | IType::BulkString(b"PING") => Ok((rem, (Cmd::Ping, taken))), |
| 231 | _ => Ok((rem, (Cmd::Disconnect, taken))), |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | // For the set command we can just return the size and start of bytes? |
| 236 |
nothing calls this directly
no test coverage detected