Skip to content

Commit c58def9

Browse files
Apply suggestions from code review
Co-authored-by: Jeremiah Senkpiel <[email protected]>
1 parent 2aba1bd commit c58def9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/conditional/if_unmodified_since.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, IF_MODIFIED_SINCE};
1+
use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, IF_UNMODIFIED_SINCE};
22
use crate::utils::{fmt_http_date, parse_http_date};
33

44
use std::fmt::Debug;
@@ -52,7 +52,7 @@ impl IfUnmodifiedSince {
5252

5353
/// Create an instance of `IfUnmodifiedSince` from a `Headers` instance.
5454
pub fn from_headers(headers: impl AsRef<Headers>) -> crate::Result<Option<Self>> {
55-
let headers = match headers.as_ref().get(IF_MODIFIED_SINCE) {
55+
let headers = match headers.as_ref().get(IF_UNMODIFIED_SINCE) {
5656
Some(headers) => headers,
5757
None => return Ok(None),
5858
};
@@ -67,12 +67,12 @@ impl IfUnmodifiedSince {
6767

6868
/// Insert a `HeaderName` + `HeaderValue` pair into a `Headers` instance.
6969
pub fn apply(&self, mut headers: impl AsMut<Headers>) {
70-
headers.as_mut().insert(IF_MODIFIED_SINCE, self.value());
70+
headers.as_mut().insert(IF_UNMODIFIED_SINCE, self.value());
7171
}
7272

7373
/// Get the `HeaderName`.
7474
pub fn name(&self) -> HeaderName {
75-
IF_MODIFIED_SINCE
75+
IF_UNMODIFIED_SINCE
7676
}
7777

7878
/// Get the `HeaderValue`.
@@ -117,7 +117,7 @@ mod test {
117117
#[test]
118118
fn bad_request_on_parse_error() -> crate::Result<()> {
119119
let mut headers = Headers::new();
120-
headers.insert(IF_MODIFIED_SINCE, "<nori ate the tag. yum.>");
120+
headers.insert(IF_UNMODIFIED_SINCE, "<nori ate the tag. yum.>");
121121
let err = IfUnmodifiedSince::from_headers(headers).unwrap_err();
122122
assert_eq!(err.status(), 400);
123123
Ok(())

0 commit comments

Comments
 (0)