Skip to content

Commit

Permalink
no-std: Fixup warning on dead code
Browse files Browse the repository at this point in the history
```
warning: variant is never constructed: `Io`
   --> cbor/src/error.rs:271:5
    |
271 |     Io,
    |     ^^
    |
    = note: #[warn(dead_code)] on by default
```

Signed-off-by: Arthur Gautier <baloo@gandi.net>
  • Loading branch information
Arthur Gautier authored and pyfisch committed Jun 13, 2019
1 parent 9eda3c2 commit a8be10e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ impl Error {
ErrorCode::Message => Category::Data,
#[cfg(feature = "std")]
ErrorCode::Io(_) => Category::Io,
#[cfg(not(feature = "std"))]
ErrorCode::Io => Category::Io,
ErrorCode::ScratchTooSmall => Category::Io,
ErrorCode::EofWhileParsingValue
| ErrorCode::EofWhileParsingArray
Expand Down Expand Up @@ -267,8 +265,6 @@ pub(crate) enum ErrorCode {
Message,
#[cfg(feature = "std")]
Io(io::Error),
#[cfg(not(feature = "std"))]
Io,
ScratchTooSmall,
EofWhileParsingValue,
EofWhileParsingArray,
Expand All @@ -292,8 +288,6 @@ impl fmt::Display for ErrorCode {
ErrorCode::Message => f.write_str("Unknown error"),
#[cfg(feature = "std")]
ErrorCode::Io(ref err) => fmt::Display::fmt(err, f),
#[cfg(not(feature = "std"))]
ErrorCode::Io => f.write_str("Unknown I/O error"),
ErrorCode::ScratchTooSmall => f.write_str("Scratch buffer too small"),
ErrorCode::EofWhileParsingValue => f.write_str("EOF while parsing a value"),
ErrorCode::EofWhileParsingArray => f.write_str("EOF while parsing an array"),
Expand Down

0 comments on commit a8be10e

Please # to comment.