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

Don't mention deprecated methods in docs #1395

Merged
merged 2 commits into from
Jan 30, 2024
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
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
//! # }
//! ```
//!
//! Parsing can be done with three methods:
//! Parsing can be done with two methods:
//!
//! 1. The standard [`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html) trait
//! (and [`parse`](https://doc.rust-lang.org/std/primitive.str.html#method.parse) method
Expand All @@ -278,12 +278,6 @@
//! [`DateTime::parse_from_rfc3339`](./struct.DateTime.html#method.parse_from_rfc3339)
//! are similar but for well-known formats.
//!
//! 3. [`Offset::datetime_from_str`](./offset/trait.TimeZone.html#method.datetime_from_str) is
//! similar but returns `DateTime` of given offset.
//! When the explicit offset is missing from the input, it simply uses given offset.
//! It issues an error when the input contains an explicit offset different
//! from the current offset.
//!
//! More detailed control over the parsing process is available via
//! [`format`](./format/index.html) module.
//!
Expand Down
4 changes: 2 additions & 2 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ impl Datelike for NaiveDate {
/// assert_eq!(NaiveDate::from_ymd_opt(-308, 3, 14).unwrap().day(), 14);
/// ```
///
/// Combined with [`NaiveDate::pred`](#method.pred),
/// Combined with [`NaiveDate::pred_opt`](#method.pred_opt),
/// one can determine the number of days in a particular month.
/// (Note that this panics when `year` is out of range.)
///
Expand Down Expand Up @@ -1613,7 +1613,7 @@ impl Datelike for NaiveDate {
/// assert_eq!(NaiveDate::from_ymd_opt(-308, 3, 14).unwrap().ordinal(), 74);
/// ```
///
/// Combined with [`NaiveDate::pred`](#method.pred),
/// Combined with [`NaiveDate::pred_opt`](#method.pred_opt),
/// one can determine the number of days in a particular year.
/// (Note that this panics when `year` is out of range.)
///
Expand Down
3 changes: 1 addition & 2 deletions src/offset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ pub trait TimeZone: Sized + Clone {
/// Makes a new `DateTime` from the number of non-leap nanoseconds
/// since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp").
///
/// Unlike [`timestamp_millis`](#method.timestamp_millis), this never
/// panics.
/// Unlike [`timestamp_millis_opt`](#method.timestamp_millis_opt), this never fails.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const fn span_for_digits(digits: u16) -> u32 {
///
/// # Limitations
/// Both rounding and truncating are done via [`Duration::num_nanoseconds`] and
/// [`DateTime::timestamp_nanos`]. This means that they will fail if either the
/// [`DateTime::timestamp_nanos_opt`]. This means that they will fail if either the
/// `Duration` or the `DateTime` are too big to represented as nanoseconds. They
/// will also fail if the `Duration` is bigger than the timestamp.
pub trait DurationRound: Sized {
Expand Down
2 changes: 1 addition & 1 deletion tests/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn now() {

// Ensure time set by the test script is correct
let now = env!("NOW");
let actual = Utc.datetime_from_str(&now, "%s").unwrap();
let actual = NaiveDateTime::parse_from_str(&now, "%s").unwrap().and_utc();
let diff = utc - actual;
assert!(
diff < chrono::Duration::minutes(5),
Expand Down