mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 10:38:57 +00:00
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:
committed by
Austin Bonander
parent
fd25a7530c
commit
5835bc4951
@@ -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")?)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user