Fix NaiveDate parse_from_str argument order

The [documentation](https://docs.rs/chrono/0.4.13/chrono/naive/struct.NaiveDate.html#method.parse_from_str) specifies that `NaiveDate::parse_from_str` takes two arguments: value and format, in respective order. 

Due to this, `DATE` fields could not be read into `NaiveDate`... and I have ptsd.
This commit is contained in:
Gevorg Hindoyan
2020-08-08 13:17:31 +04:00
committed by Austin Bonander
parent fd25a7530c
commit 5835bc4951

View File

@@ -169,7 +169,7 @@ impl<'r> Decode<'r, Sqlite> for NaiveDateTime {
impl<'r> Decode<'r, Sqlite> for NaiveDate {
fn decode(value: SqliteValueRef<'r>) -> Result<Self, BoxDynError> {
Ok(NaiveDate::parse_from_str("%F", value.text()?)?)
Ok(NaiveDate::parse_from_str(value.text()?, "%F")?)
}
}