Skip to content

Commit

Permalink
Update time 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
oherrala committed Aug 23, 2021
1 parent 7c66d5d commit f3883b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ serde = "1"
serde_derive = "1"
serde_json = "1"
sha1 = "0.6.0"
time = "0.2"
time = { version = "0.3", features = [ "local-offset" ] }
tiny_http = "0.8.1"
url = "2"
threadpool = "1"
Expand Down
3 changes: 1 addition & 2 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ where
Err(_) => return Response::empty_404(),
};

let now =
time::OffsetDateTime::try_now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc());
let now = time::OffsetDateTime::now_local().unwrap_or_else(|_| time::OffsetDateTime::now_utc());
let etag: String = (fs::metadata(&potential_file)
.map(|meta| filetime::FileTime::from_last_modification_time(&meta).unix_seconds() as u64)
.unwrap_or(now.nanosecond() as u64)
Expand Down

0 comments on commit f3883b2

Please sign in to comment.