Skip to content

Commit

Permalink
resolve error todo
Browse files Browse the repository at this point in the history
  • Loading branch information
femshima committed Jan 29, 2024
1 parent 1b4031b commit 52f926e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/model/parser/header/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub enum DeserializeError {
Eof,
ExpectedBool,
ExpectedInteger,
ExpectedString,
ExpectedArrayComma,
ExpectedMapColon,
ExpectedMapNewline,
Expand All @@ -24,8 +23,22 @@ impl Display for DeserializeError {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
DeserializeError::Message(msg) => formatter.write_str(msg),

Check warning on line 25 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L23-L25

Added lines #L23 - L25 were not covered by tests

DeserializeError::Eof => formatter.write_str("unexpected end of input"),
_ => todo!(),
DeserializeError::ExpectedBool => formatter.write_str("expected bool (0 or 1)"),
DeserializeError::ExpectedInteger => formatter.write_str("expected integer value"),

Check warning on line 29 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L27-L29

Added lines #L27 - L29 were not covered by tests
DeserializeError::ExpectedArrayComma => {
formatter.write_str("expected comma as an array delimiter")

Check warning on line 31 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L31

Added line #L31 was not covered by tests
}
DeserializeError::ExpectedMapColon => {
formatter.write_str("expected colon as map delimiter")

Check warning on line 34 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L34

Added line #L34 was not covered by tests
}
DeserializeError::ExpectedMapNewline => {
formatter.write_str("expected newline as map delimiter")

Check warning on line 37 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L37

Added line #L37 was not covered by tests
}
DeserializeError::TrailingCharacters => {
formatter.write_str("some characters were not consumed")

Check warning on line 40 in src/model/parser/header/error.rs

View check run for this annotation

Codecov / codecov/patch

src/model/parser/header/error.rs#L40

Added line #L40 was not covered by tests
}
}
}
}

0 comments on commit 52f926e

Please sign in to comment.