-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(profiles): Bump android-trace-log version to prevent panic #2457
Conversation
@@ -15,7 +15,7 @@ debug = true | |||
|
|||
[workspace.dependencies] | |||
anyhow = "1.0.66" | |||
chrono = { version = "0.4.24", default-features = false, features = [ | |||
chrono = { version = "0.4.28", default-features = false, features = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android_trace_log
uses a chrono function that is not available in 0.4.24.
@@ -130,7 +130,8 @@ impl UnixTimestamp { | |||
|
|||
/// Returns the timestamp as chrono datetime. | |||
pub fn as_datetime(self) -> Option<DateTime<Utc>> { | |||
NaiveDateTime::from_timestamp_opt(self.0 as i64, 0).map(|n| DateTime::from_utc(n, Utc)) | |||
NaiveDateTime::from_timestamp_opt(self.0 as i64, 0) | |||
.map(|n| DateTime::from_naive_utc_and_offset(n, Utc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from_utc
is deprecated since chrono 0.4.27. The function does the same under the hood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iker-barriocanal he wrote a test in android_trace_log
if that counts 😛 https://github.com/chayleaf/android-trace-log/pull/2/files
@iker-barriocanal the test would replicate the one that @TBS1996 linked, so it would not add value IMO. |
Fixes #2451.
See also chayleaf/android-trace-log#2.