From 036ffd43f964b24c1aa975efb9de48073f5b80f5 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 23 Feb 2020 06:40:02 +0900
Subject: [PATCH 1/6] Prepare for new release

---
 actix-web-codegen/CHANGES.md | 8 ++++++--
 actix-web-codegen/Cargo.toml | 8 ++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/actix-web-codegen/CHANGES.md b/actix-web-codegen/CHANGES.md
index 95696abd..13ed5d43 100644
--- a/actix-web-codegen/CHANGES.md
+++ b/actix-web-codegen/CHANGES.md
@@ -1,8 +1,12 @@
 # Changes
 
-## [0.2.NEXT] - 2020-xx-xx
+## [0.2.1] - 2020-02-23
 
-* Allow the handler function to be named as `config` #1290
+* Add `#[allow(missing_docs)]` attribute to generated structs [#1368]
+* Allow the handler function to be named as `config` [#1290]
+
+[#1368]: https://github.com/actix/actix-web/issues/1368
+[#1290]: https://github.com/actix/actix-web/issues/1290
 
 ## [0.2.0] - 2019-12-13
 
diff --git a/actix-web-codegen/Cargo.toml b/actix-web-codegen/Cargo.toml
index 3fe561de..0b926b80 100644
--- a/actix-web-codegen/Cargo.toml
+++ b/actix-web-codegen/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "actix-web-codegen"
-version = "0.2.0"
+version = "0.2.1"
 description = "Actix web proc macros"
 readme = "README.md"
 authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
@@ -17,6 +17,6 @@ syn = { version = "^1", features = ["full", "parsing"] }
 proc-macro2 = "^1"
 
 [dev-dependencies]
-actix-rt = { version = "1.0.0" }
-actix-web = { version = "2.0.0-rc" }
-futures = { version = "0.3.1" }
+actix-rt = "1.0.0"
+actix-web = "2.0.0"
+futures = "0.3.1"

From 1b77963aacb38df135cef31b2b41838d71c3b188 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 23 Feb 2020 07:08:22 +0900
Subject: [PATCH 2/6] actix-web: update `time` to 0.2.7

---
 CHANGES.md | 2 +-
 Cargo.toml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index b42635b8..5da4e19e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -9,7 +9,7 @@
 
 * Skip empty chunks when returning response from a `Stream` #1308
 
-* Update the `time` dependency to 0.2.5
+* Update the `time` dependency to 0.2.7
 
 ## [2.0.0] - 2019-12-25
 
diff --git a/Cargo.toml b/Cargo.toml
index a6783a6d..d06e47ef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -87,7 +87,7 @@ regex = "1.3"
 serde = { version = "1.0", features=["derive"] }
 serde_json = "1.0"
 serde_urlencoded = "0.6.1"
-time = { version = "0.2.5", default-features = false, features = ["std"] }
+time = { version = "0.2.7", default-features = false, features = ["std"] }
 url = "2.1"
 open-ssl = { version="0.10", package = "openssl", optional = true }
 rust-tls = { version = "0.16.0", package = "rustls", optional = true }

From f9f9fb4c840c9c6c31837d18e4984a87d662c81c Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 23 Feb 2020 07:08:50 +0900
Subject: [PATCH 3/6] actix-http-test: update `time` to 0.2.7

---
 test-server/CHANGES.md | 2 +-
 test-server/Cargo.toml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test-server/CHANGES.md b/test-server/CHANGES.md
index 617b8092..f8b29f39 100644
--- a/test-server/CHANGES.md
+++ b/test-server/CHANGES.md
@@ -2,7 +2,7 @@
 
 ## [Unreleased] - 2020-xx-xx
 
-* Update the `time` dependency to 0.2.5
+* Update the `time` dependency to 0.2.7
 
 
 ## [1.0.0] - 2019-12-13
diff --git a/test-server/Cargo.toml b/test-server/Cargo.toml
index b22414e2..774c8f0b 100644
--- a/test-server/Cargo.toml
+++ b/test-server/Cargo.toml
@@ -51,7 +51,7 @@ serde_json = "1.0"
 sha1 = "0.6"
 slab = "0.4"
 serde_urlencoded = "0.6.1"
-time = { version = "0.2.5", default-features = false, features = ["std"] }
+time = { version = "0.2.7", default-features = false, features = ["std"] }
 open-ssl = { version="0.10", package="openssl", optional = true }
 
 [dev-dependencies]

From c8ccc69b93e016e42c47978fb8cf64b87119db3e Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 23 Feb 2020 07:09:00 +0900
Subject: [PATCH 4/6] actix-http: update `time` to 0.2.7

---
 actix-http/CHANGES.md                    |  2 +-
 actix-http/Cargo.toml                    |  2 +-
 actix-http/src/cookie/mod.rs             |  4 ++--
 actix-http/src/cookie/parse.rs           | 10 +++++-----
 actix-http/src/header/shared/httpdate.rs |  8 ++++----
 actix-http/src/time_parser.rs            |  4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md
index 511ef4f1..4e8d7fd4 100644
--- a/actix-http/CHANGES.md
+++ b/actix-http/CHANGES.md
@@ -4,7 +4,7 @@
 
 ### Changed
 
-* Update the `time` dependency to 0.2.5
+* Update the `time` dependency to 0.2.7
 
 ### Fixed
 
diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml
index cd813e49..10aa79d1 100644
--- a/actix-http/Cargo.toml
+++ b/actix-http/Cargo.toml
@@ -76,7 +76,7 @@ serde_json = "1.0"
 sha-1 = "0.8"
 slab = "0.4"
 serde_urlencoded = "0.6.1"
-time = { version = "0.2.5", default-features = false, features = ["std"] }
+time = { version = "0.2.7", default-features = false, features = ["std"] }
 
 # for secure cookie
 ring = { version = "0.16.9", optional = true }
diff --git a/actix-http/src/cookie/mod.rs b/actix-http/src/cookie/mod.rs
index 09120e19..8dccd0b6 100644
--- a/actix-http/src/cookie/mod.rs
+++ b/actix-http/src/cookie/mod.rs
@@ -990,7 +990,7 @@ impl<'a, 'b> PartialEq<Cookie<'b>> for Cookie<'a> {
 #[cfg(test)]
 mod tests {
     use super::{Cookie, SameSite};
-    use time::{offset, PrimitiveDateTime};
+    use time::PrimitiveDateTime;
 
     #[test]
     fn format() {
@@ -1015,7 +1015,7 @@ mod tests {
         assert_eq!(&cookie.to_string(), "foo=bar; Domain=www.rust-lang.org");
 
         let time_str = "Wed, 21 Oct 2015 07:28:00 GMT";
-        let expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%M:%S").unwrap().using_offset(offset!(UTC));
+        let expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%M:%S").unwrap().assume_utc();
         let cookie = Cookie::build("foo", "bar").expires(expires).finish();
         assert_eq!(
             &cookie.to_string(),
diff --git a/actix-http/src/cookie/parse.rs b/actix-http/src/cookie/parse.rs
index 28eb4f8b..537069de 100644
--- a/actix-http/src/cookie/parse.rs
+++ b/actix-http/src/cookie/parse.rs
@@ -6,7 +6,7 @@ use std::fmt;
 use std::str::Utf8Error;
 
 use percent_encoding::percent_decode;
-use time::{Duration, offset};
+use time::Duration;
 
 use super::{Cookie, CookieStr, SameSite};
 
@@ -188,7 +188,7 @@ fn parse_inner<'c>(s: &str, decode: bool) -> Result<Cookie<'c>, ParseError> {
                     .or_else(|| time::parse(v, "%a, %d-%b-%Y %H:%M:%S").ok());
 
                 if let Some(time) = tm {
-                    cookie.expires = Some(time.using_offset(offset!(UTC)))
+                    cookie.expires = Some(time.assume_utc())
                 }
             }
             _ => {
@@ -216,7 +216,7 @@ where
 #[cfg(test)]
 mod tests {
     use super::{Cookie, SameSite};
-    use time::{offset, Duration, PrimitiveDateTime};
+    use time::{Duration, PrimitiveDateTime};
 
     macro_rules! assert_eq_parse {
         ($string:expr, $expected:expr) => {
@@ -376,7 +376,7 @@ mod tests {
         );
 
         let time_str = "Wed, 21 Oct 2015 07:28:00 GMT";
-        let expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%M:%S").unwrap().using_offset(offset!(UTC));
+        let expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%M:%S").unwrap().assume_utc();
         expected.set_expires(expires);
         assert_eq_parse!(
             " foo=bar ;HttpOnly; Secure; Max-Age=4; Path=/foo; \
@@ -385,7 +385,7 @@ mod tests {
         );
 
         unexpected.set_domain("foo.com");
-        let bad_expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%S:%M").unwrap().using_offset(offset!(UTC));
+        let bad_expires = PrimitiveDateTime::parse(time_str, "%a, %d %b %Y %H:%S:%M").unwrap().assume_utc();
         expected.set_expires(bad_expires);
         assert_ne_parse!(
             " foo=bar ;HttpOnly; Secure; Max-Age=4; Path=/foo; \
diff --git a/actix-http/src/header/shared/httpdate.rs b/actix-http/src/header/shared/httpdate.rs
index 1b52f0de..5227118f 100644
--- a/actix-http/src/header/shared/httpdate.rs
+++ b/actix-http/src/header/shared/httpdate.rs
@@ -20,7 +20,7 @@ impl FromStr for HttpDate {
 
     fn from_str(s: &str) -> Result<HttpDate, ParseError> {
         match time_parser::parse_http_date(s) {
-            Some(t) => Ok(HttpDate(t.using_offset(offset!(UTC)))),
+            Some(t) => Ok(HttpDate(t.assume_utc())),
             None => Err(ParseError::Header)
         }
     }
@@ -40,7 +40,7 @@ impl From<OffsetDateTime> for HttpDate {
 
 impl From<SystemTime> for HttpDate {
     fn from(sys: SystemTime) -> HttpDate {
-        HttpDate(PrimitiveDateTime::from(sys).using_offset(offset!(UTC)))
+        HttpDate(PrimitiveDateTime::from(sys).assume_utc())
     }
 }
 
@@ -66,14 +66,14 @@ impl From<HttpDate> for SystemTime {
 #[cfg(test)]
 mod tests {
     use super::HttpDate;
-    use time::{PrimitiveDateTime, date, time, offset};
+    use time::{PrimitiveDateTime, date, time};
 
     #[test]
     fn test_date() {
         let nov_07 = HttpDate(PrimitiveDateTime::new(
             date!(1994-11-07),
             time!(8:48:37)
-        ).using_offset(offset!(UTC)));
+        ).assume_utc());
 
         assert_eq!(
             "Sun, 07 Nov 1994 08:48:37 GMT".parse::<HttpDate>().unwrap(),
diff --git a/actix-http/src/time_parser.rs b/actix-http/src/time_parser.rs
index f6623d24..34fac139 100644
--- a/actix-http/src/time_parser.rs
+++ b/actix-http/src/time_parser.rs
@@ -1,4 +1,4 @@
-use time::{PrimitiveDateTime, Date};
+use time::{OffsetDateTime, PrimitiveDateTime, Date};
 
 /// Attempt to parse a `time` string as one of either RFC 1123, RFC 850, or asctime.
 pub fn parse_http_date(time: &str) -> Option<PrimitiveDateTime> {
@@ -19,7 +19,7 @@ fn try_parse_rfc_850(time: &str) -> Option<PrimitiveDateTime> {
             // If the `time` string contains a two-digit year, then as per RFC 2616 ยง 19.3,
             // we consider the year as part of this century if it's within the next 50 years,
             // otherwise we consider as part of the previous century.
-            let now = PrimitiveDateTime::now();
+            let now = OffsetDateTime::now();
             let century_start_year = (now.year() / 100) * 100;
             let mut expanded_year = century_start_year + dt.year();
 

From 845ce3cf343487ea5fc48a0d8484d75f0e8d148f Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Tue, 25 Feb 2020 07:46:03 +0900
Subject: [PATCH 5/6] Fix doc comment

---
 actix-http/src/header/common/accept_charset.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/actix-http/src/header/common/accept_charset.rs b/actix-http/src/header/common/accept_charset.rs
index 117e2015..291ca53b 100644
--- a/actix-http/src/header/common/accept_charset.rs
+++ b/actix-http/src/header/common/accept_charset.rs
@@ -63,7 +63,7 @@ header! {
     (AcceptCharset, ACCEPT_CHARSET) => (QualityItem<Charset>)+
 
     test_accept_charset {
-        /// Test case from RFC
+        // Test case from RFC
         test_header!(test1, vec![b"iso-8859-5, unicode-1-1;q=0.8"]);
     }
 }

From a4f87a53da7813e03fa5872e4ed702b21b9afd7e Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Tue, 25 Feb 2020 08:42:39 +0900
Subject: [PATCH 6/6] Update CHANGES.md

---
 actix-web-codegen/CHANGES.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/actix-web-codegen/CHANGES.md b/actix-web-codegen/CHANGES.md
index 13ed5d43..941cd36d 100644
--- a/actix-web-codegen/CHANGES.md
+++ b/actix-web-codegen/CHANGES.md
@@ -1,6 +1,6 @@
 # Changes
 
-## [0.2.1] - 2020-02-23
+## [0.2.1] - 2020-02-25
 
 * Add `#[allow(missing_docs)]` attribute to generated structs [#1368]
 * Allow the handler function to be named as `config` [#1290]