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

Update to 2021 edition #1109

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories = ["date-and-time"]
readme = "README.md"
license = "MIT/Apache-2.0"
exclude = ["/ci/*"]
edition = "2018"
edition = "2021"
rust-version = "1.56.0"

[lib]
Expand Down
2 changes: 0 additions & 2 deletions src/format/parsed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//! A collection of parsed date and time items.
//! They can be constructed incrementally while being checked for consistency.

use core::convert::TryFrom;

use super::{ParseResult, IMPOSSIBLE, NOT_ENOUGH, OUT_OF_RANGE};
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::offset::{FixedOffset, LocalResult, Offset, TimeZone};
Expand Down
5 changes: 1 addition & 4 deletions src/month.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::{convert::TryFrom, fmt};
use core::fmt;

#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};
Expand All @@ -12,7 +12,6 @@ use crate::OutOfRange;
///
/// It is possible to convert from a date to a month independently
/// ```
/// # use std::convert::TryFrom;
/// use chrono::prelude::*;
/// let date = Utc.with_ymd_and_hms(2019, 10, 28, 9, 10, 11).unwrap();
/// // `2019-10-28T09:10:11Z`
Expand Down Expand Up @@ -349,8 +348,6 @@ mod month_serde {

#[cfg(test)]
mod tests {
use core::convert::TryFrom;

use super::Month;
use crate::{Datelike, OutOfRange, TimeZone, Utc};

Expand Down
6 changes: 1 addition & 5 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#[cfg(any(feature = "alloc", feature = "std", test))]
use core::borrow::Borrow;
use core::convert::TryFrom;
use core::ops::{Add, AddAssign, RangeInclusive, Sub, SubAssign};
use core::{fmt, str};

Expand Down Expand Up @@ -2284,10 +2283,7 @@ mod tests {
};
use crate::oldtime::Duration;
use crate::{Datelike, Weekday};
use std::{
convert::{TryFrom, TryInto},
i32, u32,
};
use std::{i32, u32};

#[test]
fn diff_months() {
Expand Down
1 change: 0 additions & 1 deletion src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#[cfg(any(feature = "alloc", feature = "std", test))]
use core::borrow::Borrow;
use core::convert::TryFrom;
use core::fmt::Write;
use core::ops::{Add, AddAssign, Sub, SubAssign};
use core::{fmt, str};
Expand Down
1 change: 0 additions & 1 deletion src/naive/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ const fn weekday_from_u32_mod7(n: u32) -> Weekday {

#[cfg(test)]
mod tests {
use std::convert::TryFrom;
use std::u32;

use super::weekday_from_u32_mod7;
Expand Down
4 changes: 1 addition & 3 deletions src/weekday.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::{convert::TryFrom, fmt};
use core::fmt;

#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};
Expand All @@ -14,7 +14,6 @@ use crate::OutOfRange;
/// # Example
/// ```
/// use chrono::Weekday;
/// use std::convert::TryFrom;
///
/// let monday = "Monday".parse::<Weekday>().unwrap();
/// assert_eq!(monday, Weekday::Mon);
Expand Down Expand Up @@ -233,7 +232,6 @@ impl fmt::Debug for ParseWeekdayError {
#[cfg(test)]
mod tests {
use super::Weekday;
use std::convert::TryFrom;

#[test]
fn test_num_days_from() {
Expand Down