glassbench
glassbench copied to clipboard
refactor: remove deprecated usage of `chrono`
This PR fixes the following warnings:
warning: use of deprecated associated function `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> src/db.rs:180:19
|
180 | time: Utc.timestamp(row.get(1)?, 0),
| ^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated associated function `chrono::TimeZone::timestamp`: use `timestamp_opt()` instead
--> src/db.rs:210:19
|
210 | time: Utc.timestamp(row.get(0)?, 0),
| ^^^^^^^^^
warning: `glassbench` (lib) generated 2 warnings
Let me know if you're fine with unwrap()
. I tried to use the custom error implementation with LocalResult
but couldn't do it. I can look into alternative ways.
I don't really see a point, there. Why remove the other function if there's exactly the same level of safety ?
They probably decided to make the error handling more explicit. With this change at least you won't get deprecation warnings during build.