time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.09k stars 273 forks source link

Fix new Rust 1.67 clippy errors #545

Closed Kinrany closed 1 year ago

Kinrany commented 1 year ago

Fixes new Clippy warnings that came with Rust 1.67.

Warnings:

Also fixes a formatting issue: comments around undocumented_unsafe_blocks: //false positive was being considered part of the same comment block with the following // SAFETY: ... comment, so the latter was indented to be on the same level. Like

let x = 0; // first value
           // will be used later

Rust-analyzer and cargo fmt also seemingly disagreed on the correct way to format time/src/formatting/mod.rs#L128.

codecov[bot] commented 1 year ago

Codecov Report

Merging #545 (e1f6175) into main (c45264c) will decrease coverage by 0.0%. The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main    #545     +/-   ##
=======================================
- Coverage   95.3%   95.3%   -0.0%     
=======================================
  Files         78      78             
  Lines       8563    8558      -5     
=======================================
- Hits        8157    8152      -5     
  Misses       406     406             
Impacted Files Coverage Δ
time/src/date_time.rs 94.0% <100.0%> (ø)
time/src/formatting/mod.rs 100.0% <100.0%> (ø)
time/src/instant.rs 100.0% <100.0%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

jhpratt commented 1 year ago

I am making the changes myself so that I can move ahead with other work without CI failing. Closing for that reason.

Kinrany commented 1 year ago

Absolutely, sorry I didn't have time! I'm glad if the PR was of any help.

jhpratt commented 1 year ago

Not an issue! I ended up pushing changes similar to what would have been the end result of this PR.