Skip to content

Conversation

@elpiel
Copy link

@elpiel elpiel commented Nov 21, 2022

No description provided.

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
Comment on lines 109 to 112
pub fn modification_date(&self) -> DateTime<Utc> {
let epoch = unsafe { (*self.inner).modificationdate };
Utc.timestamp(epoch, 0)
Utc.timestamp_opt(epoch, 0).unwrap()
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better to return the DateTime<Utc> wrapped inside Option so we avoid unwrap?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be, however, I wanted to do as little as possible changes to remove the deprecation. Chrono is doing unwrap() anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants