- 
                Notifications
    You must be signed in to change notification settings 
- Fork 47
fix: Switch to using time-rs #72
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
fix: Switch to using time-rs #72
Conversation
        
          
                src/date.rs
              
                Outdated
          
        
      | let datetime: DateTime<Utc> = self.inner.into(); | ||
| datetime.to_rfc3339_opts(SecondsFormat::Secs, true) | ||
| let datetime: OffsetDateTime = self.inner.into(); | ||
| return datetime.format(&Rfc3339).unwrap_or_default(); | 
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.
This should probably just be an unwrap(). I can't see why it would fail, and if it does I'd rather panic than output an invalid plist.
| The minimum Rust version in  | 
| 🤦 should have just looked at time.rs on GitHub. Their MSRV is 1.51.0 so ours will have to be as well. | 
Currently chrono has a vulnerability in it. This switches to the underlying time-rs library that chrono uses. https://rustsec.org/advisories/RUSTSEC-2020-0159 BC BREAK: this raises the minimum supported rust version to 1.51.0
| Thanks | 
| @ebarnard great that plist has merged a fix for this already! can we have a patch release containing it? that would be highly appreciated ❤️ | 
| I suppose we need to decide what the MSRV policy is. The time-rs change bumped it up by a year and a quarter to a release from March this year. My gut feeling is this should go in a minor release along with #70 once I've had a chance to get that working with  | 
| Released in v1.3.0. | 
A recent release of plist bumped MSRV to 1.51 (see ebarnard/rust-plist#72 and discussions theirin), so we need to do that as well to fix this build error in CI: ``` error: failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/time-0.3.5/Cargo.toml` Caused by: feature `resolver` is required this Cargo does not support nightly features, but if you switch to nightly channel you can add `cargo-features = ["resolver"]` to enable this feature ```
Fixes RUSTSEC-2020-0159 Ref ebarnard/rust-plist#72
Currently chrono has a vulnerability in it. This switches to the
underlying time-rs library that chrono uses.
https://rustsec.org/advisories/RUSTSEC-2020-0159