mirror of https://github.com/http-rs/http-types
Fix clippy lints
This commit is contained in:
parent
1fe07df286
commit
ac5d645ce5
|
@ -129,7 +129,7 @@ impl PartialEq<String> for HeaderName {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<&String> for HeaderName {
|
||||
impl PartialEq<&String> for HeaderName {
|
||||
fn eq(&self, other: &&String) -> bool {
|
||||
match HeaderName::from_str(other) {
|
||||
Err(_) => false,
|
||||
|
|
|
@ -125,7 +125,7 @@ impl PartialEq<String> for HeaderValue {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<&String> for HeaderValue {
|
||||
impl PartialEq<&String> for HeaderValue {
|
||||
fn eq(&self, other: &&String) -> bool {
|
||||
&&self.inner == other
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ impl PartialEq<String> for HeaderValues {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<&String> for HeaderValues {
|
||||
impl PartialEq<&String> for HeaderValues {
|
||||
fn eq(&self, other: &&String) -> bool {
|
||||
self.inner.len() == 1 && self.inner[0] == **other
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn construct_shorthand_with_valid_status_code() {
|
||||
let _res = Some(()).status(200).unwrap();
|
||||
Some(()).status(200).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -180,6 +180,6 @@ mod test {
|
|||
fn construct_shorthand_with_invalid_status_code() {
|
||||
let res: Result<(), std::io::Error> =
|
||||
Err(std::io::Error::new(std::io::ErrorKind::Other, "oh no!"));
|
||||
let _res = res.status(600).unwrap();
|
||||
res.status(600).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -725,7 +725,7 @@ mod test {
|
|||
assert_eq!(StatusCode::Accepted, status_code);
|
||||
assert_eq!(
|
||||
Some(202),
|
||||
serde_json::to_value(&StatusCode::Accepted)?.as_u64()
|
||||
serde_json::to_value(StatusCode::Accepted)?.as_u64()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue