Skip to content

Commit

Permalink
Match exhaustively in the impl of Display for Error to avoid an infin…
Browse files Browse the repository at this point in the history
…ite loop in the default match arm.
  • Loading branch information
jimmycuadra committed Apr 14, 2016
1 parent 8191c9b commit 6179a4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/error_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
match *self {
Error::Api(ref error) => write!(f, "{}", error),
Error::Http(ref error) => write!(f, "{}", error),
Error::InvalidConditions(reason) => write!(f, "{}", reason),
Error::NoEndpoints => write!(f, "At least one endpoint is required to create a Client"),
ref error => write!(f, "{}", error),
Error::InvalidUrl(ref error) => write!(f, "{}", error),
Error::Io(ref error) => write!(f, "{}", error),
Error::NoEndpoints => f.write_str("At least one endpoint is required to create a Client"),
}
}
}
Expand Down

0 comments on commit 6179a4b

Please sign in to comment.