diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e6f6f935e..e43ab571e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -143,7 +143,7 @@ release notes on [GitHub](/~https://github.com/chronotope/chrono/releases). ### Fixes -* Make Datetime arithmatic adjust their offsets after discovering their new +* Make Datetime arithmetic adjust their offsets after discovering their new timestamps (@quodlibetor #337) * Put wasm-bindgen related code and dependencies behind a `wasmbind` feature gate. (@quodlibetor #335) @@ -599,7 +599,7 @@ and replaced by 0.2.25 very shortly. Duh.) ### Added -- `Offset` is splitted into `TimeZone` (constructor) and `Offset` (storage) types. +- `Offset` is split into `TimeZone` (constructor) and `Offset` (storage) types. You would normally see only the former, as the latter is mostly an implementation detail. Most importantly, `Local` now can be used to directly construct timezone-aware values. @@ -661,7 +661,7 @@ and replaced by 0.2.25 very shortly. Duh.) so we simply let it go. In the case that `Time` is really required, one can use a simpler `NaiveTime`. - `NaiveTime` and `NaiveDate` can be freely combined and splitted, + `NaiveTime` and `NaiveDate` can be freely combined and split, and `TimeZone::from_{local,utc}_datetime` can be used to convert from/to the local time. - `with_offset` method has been removed. Use `with_timezone` method instead. diff --git a/src/format/mod.rs b/src/format/mod.rs index 447efde817..95d86dcd8d 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -422,7 +422,7 @@ pub enum ParseErrorKind { /// All formatting items have been read but there is a remaining input. TooLong, - /// There was an error on the formatting string, or there were non-supported formating items. + /// There was an error on the formatting string, or there were non-supported formatting items. BadFormat, // TODO: Change this to `#[non_exhaustive]` (on the enum) with the next breaking release. diff --git a/src/format/parse.rs b/src/format/parse.rs index 9c08bdb67f..5a3a702734 100644 --- a/src/format/parse.rs +++ b/src/format/parse.rs @@ -508,7 +508,7 @@ where } /// Accepts a relaxed form of RFC3339. -/// A space or a 'T' are acepted as the separator between the date and time +/// A space or a 'T' are accepted as the separator between the date and time /// parts. Additional spaces are allowed between each component. /// /// All of these examples are equivalent: diff --git a/src/format/parsed.rs b/src/format/parsed.rs index e611dfdafa..e14f03f425 100644 --- a/src/format/parsed.rs +++ b/src/format/parsed.rs @@ -536,7 +536,7 @@ impl Parsed { /// /// # Errors /// - /// Returns `OUT_OF_RANGE` if `value` is ouside the range of an `i32`. + /// Returns `OUT_OF_RANGE` if `value` is outside the range of an `i32`. /// /// Returns `IMPOSSIBLE` if this field was already set to a different value. #[inline] diff --git a/src/offset/local/tz_info/rule.rs b/src/offset/local/tz_info/rule.rs index b74eeed156..5e45682799 100644 --- a/src/offset/local/tz_info/rule.rs +++ b/src/offset/local/tz_info/rule.rs @@ -589,11 +589,11 @@ impl RuleDay { let week_day_of_first_month_day = (4 + days_since_unix_epoch(year, month, 1)).rem_euclid(DAYS_PER_WEEK); - let first_week_day_occurence_in_month = + let first_week_day_occurrence_in_month = 1 + (week_day as i64 - week_day_of_first_month_day).rem_euclid(DAYS_PER_WEEK); let mut month_day = - first_week_day_occurence_in_month + (week as i64 - 1) * DAYS_PER_WEEK; + first_week_day_occurrence_in_month + (week as i64 - 1) * DAYS_PER_WEEK; if month_day > day_in_month { month_day -= DAYS_PER_WEEK } diff --git a/src/offset/local/tz_info/timezone.rs b/src/offset/local/tz_info/timezone.rs index 15123256f4..268739c21a 100644 --- a/src/offset/local/tz_info/timezone.rs +++ b/src/offset/local/tz_info/timezone.rs @@ -252,7 +252,7 @@ impl<'a> TimeZoneRef<'a> { match transition_start.cmp(&transition_end) { Ordering::Greater => { - // bakwards transition, eg from DST to regular + // backwards transition, eg from DST to regular // this means a given local time could have one of two possible offsets if local_leap_time < transition_end { return Ok(crate::MappedLocalTime::Single(prev)); diff --git a/tests/dateutils.rs b/tests/dateutils.rs index 2dfca90023..a0a445aa99 100644 --- a/tests/dateutils.rs +++ b/tests/dateutils.rs @@ -144,8 +144,8 @@ fn verify_against_date_command_format_local(path: &'static str, dt: NaiveDateTim let ldt = Local .from_local_datetime(&date.and_hms_opt(dt.hour(), dt.minute(), dt.second()).unwrap()) .unwrap(); - let formated_date = format!("{}\n", ldt.format(required_format)); - assert_eq!(date_command_str, formated_date); + let formatted_date = format!("{}\n", ldt.format(required_format)); + assert_eq!(date_command_str, formatted_date); } #[test]