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

Prepare 0.4.22 #773

Merged
merged 4 commits into from Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "chrono"
version = "0.4.21"
version = "0.4.22"
description = "Date and time library for Rust"
homepage = "https://github.com/chronotope/chrono"
documentation = "https://docs.rs/chrono/"
Expand Down Expand Up @@ -40,7 +40,7 @@ serde = { version = "1.0.99", default-features = false, optional = true }
pure-rust-locales = { version = "0.5.2", optional = true }
criterion = { version = "0.3", optional = true }
rkyv = {version = "0.7", optional = true}
iana-time-zone = { version = "0.1.41", optional = true, features = ["fallback"] }
iana-time-zone = { version = "0.1.44", optional = true, features = ["fallback"] }

[target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies]
wasm-bindgen = { version = "0.2", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/format/parsed.rs
Expand Up @@ -22,7 +22,7 @@ use crate::{Datelike, Timelike};
///
/// - `to_*` methods try to make a concrete date and time value out of set fields.
/// It fully checks any remaining out-of-range conditions and inconsistent/impossible fields.
#[derive(Clone, PartialEq, Debug, Default)]
#[derive(Clone, PartialEq, Eq, Debug, Default)]
pub struct Parsed {
/// Year.
///
Expand Down
2 changes: 1 addition & 1 deletion src/month.rs
Expand Up @@ -201,7 +201,7 @@ impl Months {
}

/// An error resulting from reading `<Month>` value with `FromStr`.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
Copy link
Contributor

Choose a reason for hiding this comment

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

+Copy while you're at it? Or don't you want to make this promise in case of possible future changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just fixing up clippy stuff here, don't want to muddle it with unrelated changes.

pub struct ParseMonthError {
pub(crate) _dummy: (),
}
Expand Down
2 changes: 1 addition & 1 deletion src/naive/date.rs
Expand Up @@ -207,7 +207,7 @@ fn test_date_bounds() {
impl NaiveDate {
/// Makes a new `NaiveDate` from year and packed ordinal-flags, with a verification.
fn from_of(year: i32, of: Of) -> Option<NaiveDate> {
if year >= MIN_YEAR && year <= MAX_YEAR && of.valid() {
if (MIN_YEAR..=MAX_YEAR).contains(&year) && of.valid() {
let Of(of) = of;
Some(NaiveDate { ymdf: (year << 13) | (of as DateImpl) })
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/naive/time/mod.rs
Expand Up @@ -536,7 +536,6 @@ impl NaiveTime {
/// assert_eq!(from_hms(3, 4, 5).overflowing_add_signed(Duration::hours(-7)),
/// (from_hms(20, 4, 5), -86_400));
/// ```
#[cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))]
pub fn overflowing_add_signed(&self, mut rhs: OldDuration) -> (NaiveTime, i64) {
let mut secs = self.secs;
let mut frac = self.frac;
Expand Down Expand Up @@ -585,7 +584,7 @@ impl NaiveTime {
frac -= 1_000_000_000;
secs += 1;
}
debug_assert!(-86_400 <= secs && secs < 2 * 86_400);
debug_assert!((-86_400..2 * 86_400).contains(&secs));
debug_assert!((0..1_000_000_000).contains(&frac));

if secs < 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/offset/local/tz_info/parser.rs
Expand Up @@ -229,7 +229,7 @@ impl<'a> Cursor<'a> {
}

pub(crate) fn peek(&self) -> Option<&u8> {
self.remaining().get(0)
self.remaining().first()
}

/// Returns remaining data
Expand Down
2 changes: 1 addition & 1 deletion src/offset/local/tz_info/rule.rs
Expand Up @@ -399,7 +399,7 @@ fn parse_rule_time(cursor: &mut Cursor) -> Result<i32, Error> {
fn parse_rule_time_extended(cursor: &mut Cursor) -> Result<i32, Error> {
let (sign, hour, minute, second) = parse_signed_hhmmss(cursor)?;

if hour < -167 || hour > 167 {
if !(-167..=167).contains(&hour) {
return Err(Error::InvalidTzString("invalid day time hour"));
}
if !(0..=59).contains(&minute) {
Expand Down
2 changes: 1 addition & 1 deletion src/weekday.rs
Expand Up @@ -186,7 +186,7 @@ impl num_traits::FromPrimitive for Weekday {
}

/// An error resulting from reading `Weekday` value with `FromStr`.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct ParseWeekdayError {
pub(crate) _dummy: (),
}
Expand Down