Clean some code, add README

This commit is contained in:
2021-05-20 19:30:26 -04:00
parent 200cf73248
commit 447ad25c8a
3 changed files with 102 additions and 5 deletions

View File

@@ -17,10 +17,7 @@ impl FromStr for Format {
fn from_str(s: &str) -> Result<Self> {
match s.trim().to_lowercase().as_str() {
"json" => Ok(Format::Json),
"text" => Ok(Format::PlainText),
"plain" => Ok(Format::PlainText),
"plain_text" => Ok(Format::PlainText),
"plaintext" => Ok(Format::PlainText),
"text" | "plain" | "plain_text" | "plaintext" => Ok(Format::PlainText),
_ => Err(anyhow!("Unrecognized format {}", s)),
}
}

View File

@@ -364,7 +364,6 @@ fn parse_field_header(input: &[u8]) -> IResult<&[u8], FieldHeader> {
todo!()
}
let (input, size) = le_u16(input)?;
// let (input, data) = take(size)(input)?;
Ok((input, FieldHeader { field_type, size }))
}