Skip to content

Conversation

@josecelano
Copy link
Member

It fixes this build warning:

warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
  --> src/upgrades/from_v1_0_0_to_v2_0_0/databases/sqlite_v2_0_0.rs:53:41
   |
53 |     let naive_datetime = NaiveDateTime::from_timestamp(timestamp, 0);
   |                                         ^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

```
warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
  --> src/upgrades/from_v1_0_0_to_v2_0_0/databases/sqlite_v2_0_0.rs:53:41
   |
53 |     let naive_datetime = NaiveDateTime::from_timestamp(timestamp, 0);
   |                                         ^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default
```
@josecelano josecelano marked this pull request as ready for review May 5, 2023 09:27
And safer type convertion from i64 (timestamp) to u64.
@josecelano josecelano merged commit 7a02569 into torrust:develop May 5, 2023
@josecelano josecelano deleted the iisue-132-fix-deprecate-chrono-function branch May 5, 2023 10:12
@da2ce7 da2ce7 added the Code Cleanup / Refactoring Tidying and Making Neat label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup / Refactoring Tidying and Making Neat

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Fix build warning: deprecated associated function chrono::NaiveDateTime::from_timestamp

2 participants