Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
grego committed Dec 11, 2022
1 parent e424803 commit ad178ae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blades"
version = "0.5.0-alpha"
version = "0.5.0"
authors = ["Maroš Grego <maros@grego.site>"]
edition = "2021"
description = "Blazing fast dead simple static site generator"
Expand All @@ -20,7 +20,7 @@ chrono = { version = "^0.4.19", features = ["std", "serde"], default_features =
fnv = "1.0"
hashbrown = { version = "0.12", features = ["inline-more", "serde"], default_features = false }
pulldown-cmark = { version = "0.9", default_features = false }
cmark-syntax = "0.3"
cmark-syntax = "0.4"

# Cargo doesn't support binary-only dependencies yet.
toml = { version = "0.5.9", optional = true }
Expand Down
5 changes: 4 additions & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ impl<'de> Deserialize<'de> for DateTime {

fn visit_str<E: de::Error>(self, v: &str) -> Result<Self::Value, E> {
v.parse::<NaiveDateTime>()
.or_else(|_| v.parse::<NaiveDate>().map(|d| d.and_hms(0, 0, 0)))
.or_else(|_| {
v.parse::<NaiveDate>()
.map(|d| d.and_hms_opt(0, 0, 0).unwrap())
})
.or_else(|_| NaiveDateTime::parse_from_str(v, "%F %T%.f"))
.or_else(|_| v.parse::<CDateTime<FixedOffset>>().map(|d| d.naive_utc()))
.map(DateTime)
Expand Down

0 comments on commit ad178ae

Please sign in to comment.