Skip to content

Commit

Permalink
Revert "Refactor Method::is_idempotent for readability (hyperium#348)"
Browse files Browse the repository at this point in the history
This reverts commit 6b07ee4.
  • Loading branch information
sfackler committed Dec 2, 2019
1 parent c89cfc9 commit b1b8ef8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/method.rs
Expand Up @@ -206,9 +206,13 @@ impl Method {
/// See [the spec](https://tools.ietf.org/html/rfc7231#section-4.2.2) for
/// more words.
pub fn is_idempotent(&self) -> bool {
match self.0 {
Put | Delete | _ if self.is_safe() => true,
_ => false
if self.is_safe() {
true
} else {
match self.0 {
Put | Delete => true,
_ => false
}
}
}

Expand Down

0 comments on commit b1b8ef8

Please sign in to comment.