clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

Migrate off deprecated chrono interfaces

Open nickgarfield opened this issue 2 years ago • 3 comments

When building, we get a few of these warnings. Let's migrate from from_timestamp() to from_timestamp_opt().

warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
   --> src/state/thread.rs:557:28
    |
557 |             NaiveDateTime::from_timestamp(after, 0),
    |                            ^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

nickgarfield avatar Dec 05 '22 18:12 nickgarfield

@nickgarfield not seeing these warnings anywhere, steps to reproduce?

env: rustc 1.65.0 (897e37553 2022-11-02)

Rhovian avatar Dec 06 '22 23:12 Rhovian

I was seeing these when running our "build all" script. It does a cargo build, anchor build, and then sets up the localnet configs.

./scripts/build-all.sh . 

nickgarfield avatar Dec 06 '22 23:12 nickgarfield

Update: these warnings are only thrown when using the Rust nightly toolchain. No need for an immediate fix.

nickgarfield avatar Dec 06 '22 23:12 nickgarfield