Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day of year formatting now parses elapsed time #253

Conversation

ChristopherRabotin
Copy link
Member

This is was an oversight of the code and testing.

Fix #248

This is was an oversight of the code and testing.

Fix #248
@@ -1,6 +1,6 @@
[package]
name = "hifitime"
version = "3.8.3"
version = "3.8.4"
Copy link
Member Author

Choose a reason for hiding this comment

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

Auto-formatting of the TOML and version bump.

@@ -309,7 +309,14 @@ impl Format {
};

let epoch = match day_of_year {
Some(days) => Epoch::from_day_of_year(decomposed[0], days, ts),
Some(days) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the oversight.

@@ -522,3 +529,10 @@ fn epoch_format_from_str() {
let fmt = Format::from_str("%a, %d %b %Y %H:%M:%S").unwrap();
assert_eq!(fmt, crate::efmt::consts::RFC2822);
}

#[test]
fn gh_248_regression() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added related regression test.

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06% 🎉

Comparison is base (f410365) 80.62% compared to head (559c630) 80.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #253      +/-   ##
==========================================
+ Coverage   80.62%   80.68%   +0.06%     
==========================================
  Files          15       15              
  Lines        3736     3748      +12     
==========================================
+ Hits         3012     3024      +12     
  Misses        724      724              
Files Changed Coverage Δ
src/asn1der.rs 83.69% <ø> (ø)
src/deprecated.rs 0.00% <ø> (ø)
src/duration.rs 83.20% <ø> (ø)
src/efmt/formatter.rs 74.71% <ø> (ø)
src/epoch.rs 88.03% <ø> (ø)
src/errors.rs 37.50% <ø> (ø)
src/leap_seconds.rs 97.56% <ø> (ø)
src/leap_seconds_file.rs 82.85% <ø> (ø)
src/month.rs 30.90% <ø> (ø)
src/parser.rs 77.22% <ø> (ø)
... and 5 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

@ChristopherRabotin ChristopherRabotin left a comment

Choose a reason for hiding this comment

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

\o/

@ChristopherRabotin ChristopherRabotin merged commit b58ed96 into master Aug 20, 2023
31 checks passed
@ChristopherRabotin ChristopherRabotin deleted the 248-epochfrom_format_str-does-not-set-hours-minutes-and-seconds branch September 2, 2023 17:54
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.

Epoch::from_format_str() does not set hours, minutes and seconds?
1 participant