Skip to content

Commit

Permalink
Convert manual documentation links
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Sep 27, 2023
1 parent b7857ba commit 604b92a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 42 deletions.
14 changes: 5 additions & 9 deletions src/format/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,21 +512,17 @@ pub enum SecondsFormat {
/// Format whole seconds only, with no decimal point nor subseconds.
Secs,

/// Use fixed 3 subsecond digits. This corresponds to
/// [Fixed::Nanosecond3](format/enum.Fixed.html#variant.Nanosecond3).
/// Use fixed 3 subsecond digits. This corresponds to [Fixed::Nanosecond3].
Millis,

/// Use fixed 6 subsecond digits. This corresponds to
/// [Fixed::Nanosecond6](format/enum.Fixed.html#variant.Nanosecond6).
/// Use fixed 6 subsecond digits. This corresponds to [Fixed::Nanosecond6].
Micros,

/// Use fixed 9 subsecond digits. This corresponds to
/// [Fixed::Nanosecond9](format/enum.Fixed.html#variant.Nanosecond9).
/// Use fixed 9 subsecond digits. This corresponds to [Fixed::Nanosecond9].
Nanos,

/// Automatically select one of `Secs`, `Millis`, `Micros`, or `Nanos` to
/// display all available non-zero sub-second digits. This corresponds to
/// [Fixed::Nanosecond](format/enum.Fixed.html#variant.Nanosecond).
/// Automatically select one of `Secs`, `Millis`, `Micros`, or `Nanos` to display all available
/// non-zero sub-second digits. This corresponds to [Fixed::Nanosecond].
AutoSi,

// Do not match against this.
Expand Down
26 changes: 12 additions & 14 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ impl NaiveWeek {
}

/// Returns a [`RangeInclusive<T>`] representing the whole week bounded by
/// [first_day](./struct.NaiveWeek.html#method.first_day) and
/// [last_day](./struct.NaiveWeek.html#method.last_day) functions.
/// [first_day](NaiveWeek::first_day) and [last_day](NaiveWeek::last_day) functions.
///
/// # Panics
///
Expand Down Expand Up @@ -160,12 +159,12 @@ impl Days {
///
/// * ISO 8601 calendars has the year 0, which is 1 BCE (a year before 1 CE).
/// If you need a typical BCE/BC and CE/AD notation for year numbers,
/// use the [`Datelike::year_ce`](../trait.Datelike.html#method.year_ce) method.
/// use the [`Datelike::year_ce`] method.
///
/// # Week Date
///
/// The ISO 8601 **week date** is a triple of year number, week number
/// and [day of the week](../enum.Weekday.html) with the following rules:
/// and [day of the week](Weekday) with the following rules:
///
/// * A week consists of Monday through Sunday, and is always numbered within some year.
/// The week number ranges from 1 to 52 or 53 depending on the year.
Expand All @@ -176,10 +175,9 @@ impl Days {
/// * The year number in the week date may *not* correspond to the actual Gregorian year.
/// For example, January 3, 2016 (Sunday) was on the last (53rd) week of 2015.
///
/// Chrono's date types default to the ISO 8601 [calendar date](#calendar-date),
/// but [`Datelike::iso_week`](../trait.Datelike.html#tymethod.iso_week) and
/// [`Datelike::weekday`](../trait.Datelike.html#tymethod.weekday) methods
/// can be used to get the corresponding week date.
/// Chrono's date types default to the ISO 8601 [calendar date](#calendar-date), but
/// [`Datelike::iso_week`] and [`Datelike::weekday`] methods can be used to get the corresponding
/// week date.
///
/// # Ordinal Date
///
Expand Down Expand Up @@ -542,7 +540,7 @@ impl NaiveDate {
}

/// Parses a string with the specified format string and returns a new `NaiveDate`.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// # Example
Expand Down Expand Up @@ -591,7 +589,7 @@ impl NaiveDate {

/// Parses a string from a user-specified format into a new `NaiveDate` value, and a slice with
/// the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
Expand Down Expand Up @@ -1280,7 +1278,7 @@ impl NaiveDate {
}

/// Formats the date with the specified format string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// This returns a `DelayedFormat`,
Expand Down Expand Up @@ -2139,7 +2137,7 @@ impl DoubleEndedIterator for NaiveDateWeeksIterator {
impl FusedIterator for NaiveDateWeeksIterator {}

/// The `Debug` output of the naive date `d` is the same as
/// [`d.format("%Y-%m-%d")`](../format/strftime/index.html).
/// [`d.format("%Y-%m-%d")`](crate::format::strftime).
///
/// The string printed can be readily parsed via the `parse` method on `str`.
///
Expand Down Expand Up @@ -2182,7 +2180,7 @@ impl fmt::Debug for NaiveDate {
}

/// The `Display` output of the naive date `d` is the same as
/// [`d.format("%Y-%m-%d")`](../format/strftime/index.html).
/// [`d.format("%Y-%m-%d")`](crate::format::strftime).
///
/// The string printed can be readily parsed via the `parse` method on `str`.
///
Expand Down Expand Up @@ -2210,7 +2208,7 @@ impl fmt::Display for NaiveDate {
}

/// Parsing a `str` into a `NaiveDate` uses the same format,
/// [`%Y-%m-%d`](../format/strftime/index.html), as in `Debug` and `Display`.
/// [`%Y-%m-%d`](crate::format::strftime), as in `Debug` and `Display`.
///
/// # Example
///
Expand Down
20 changes: 9 additions & 11 deletions src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX;
///
/// # Example
///
/// `NaiveDateTime` is commonly created from [`NaiveDate`](./struct.NaiveDate.html).
/// `NaiveDateTime` is commonly created from [`NaiveDate`].
///
/// ```
/// use chrono::{NaiveDate, NaiveDateTime};
Expand All @@ -62,8 +62,7 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX;
/// # let _ = dt;
/// ```
///
/// You can use typical [date-like](../trait.Datelike.html) and
/// [time-like](../trait.Timelike.html) methods,
/// You can use typical [date-like](Datelike) and [time-like](Timelike) methods,
/// provided that relevant traits are in the scope.
///
/// ```
Expand Down Expand Up @@ -113,8 +112,7 @@ impl NaiveDateTime {
/// since the midnight UTC on January 1, 1970 (aka "UNIX timestamp")
/// and the number of nanoseconds since the last whole non-leap second.
///
/// For a non-naive version of this function see
/// [`TimeZone::timestamp`](../offset/trait.TimeZone.html#method.timestamp).
/// For a non-naive version of this function see [`TimeZone::timestamp`].
///
/// The nanosecond part can exceed 1,000,000,000 in order to represent a
/// [leap second](NaiveTime#leap-second-handling), but only when `secs % 60 == 59`.
Expand Down Expand Up @@ -244,7 +242,7 @@ impl NaiveDateTime {
}

/// Parses a string with the specified format string and returns a new `NaiveDateTime`.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// # Example
Expand Down Expand Up @@ -322,7 +320,7 @@ impl NaiveDateTime {

/// Parses a string with the specified format string and returns a new `NaiveDateTime`, and a
/// slice with the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
Expand Down Expand Up @@ -958,7 +956,7 @@ impl NaiveDateTime {
}

/// Formats the combined date and time with the specified format string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// This returns a `DelayedFormat`,
Expand Down Expand Up @@ -1087,7 +1085,7 @@ impl Datelike for NaiveDateTime {
///
/// The return value ranges from 0 to 11.
///
/// See also the [`NaiveDate::month0`](./struct.NaiveDate.html#method.month0) method.
/// See also the [`NaiveDate::month0`] method.
///
/// # Example
///
Expand Down Expand Up @@ -1125,7 +1123,7 @@ impl Datelike for NaiveDateTime {
///
/// The return value ranges from 0 to 30. (The last day of month differs by months.)
///
/// See also the [`NaiveDate::day0`](./struct.NaiveDate.html#method.day0) method.
/// See also the [`NaiveDate::day0`] method.
///
/// # Example
///
Expand Down Expand Up @@ -1163,7 +1161,7 @@ impl Datelike for NaiveDateTime {
///
/// The return value ranges from 0 to 365. (The last day of year differs by years.)
///
/// See also the [`NaiveDate::ordinal0`](./struct.NaiveDate.html#method.ordinal0) method.
/// See also the [`NaiveDate::ordinal0`] method.
///
/// # Example
///
Expand Down
12 changes: 6 additions & 6 deletions src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl NaiveTime {
}

/// Parses a string with the specified format string and returns a new `NaiveTime`.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// # Example
Expand Down Expand Up @@ -542,7 +542,7 @@ impl NaiveTime {

/// Parses a string from a user-specified format into a new `NaiveTime` value, and a slice with
/// the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
Expand Down Expand Up @@ -819,7 +819,7 @@ impl NaiveTime {
}

/// Formats the time with the specified format string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// See the [`format::strftime` module](crate::format::strftime)
/// on the supported escape sequences.
///
/// This returns a `DelayedFormat`,
Expand Down Expand Up @@ -1373,7 +1373,7 @@ impl Sub<NaiveTime> for NaiveTime {
}

/// The `Debug` output of the naive time `t` is the same as
/// [`t.format("%H:%M:%S%.f")`](../format/strftime/index.html).
/// [`t.format("%H:%M:%S%.f")`](crate::format::strftime).
///
/// The string printed can be readily parsed via the `parse` method on `str`.
///
Expand Down Expand Up @@ -1429,7 +1429,7 @@ impl fmt::Debug for NaiveTime {
}

/// The `Display` output of the naive time `t` is the same as
/// [`t.format("%H:%M:%S%.f")`](../format/strftime/index.html).
/// [`t.format("%H:%M:%S%.f")`](crate::format::strftime).
///
/// The string printed can be readily parsed via the `parse` method on `str`.
///
Expand Down Expand Up @@ -1463,7 +1463,7 @@ impl fmt::Display for NaiveTime {
}

/// Parsing a `str` into a `NaiveTime` uses the same format,
/// [`%H:%M:%S%.f`](../format/strftime/index.html), as in `Debug` and `Display`.
/// [`%H:%M:%S%.f`](crate::format::strftime), as in `Debug` and `Display`.
///
/// # Example
///
Expand Down
3 changes: 1 addition & 2 deletions src/offset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ pub trait Offset: Sized + Clone + fmt::Debug {

/// The time zone.
///
/// The methods here are the primarily constructors for [`Date`](../struct.Date.html) and
/// [`DateTime`](../struct.DateTime.html) types.
/// The methods here are the primary constructors for [`Date`] and [`DateTime`] types.
pub trait TimeZone: Sized + Clone {
/// An associated offset type.
/// This type is used to store the actual offset in date and time types.
Expand Down

0 comments on commit 604b92a

Please sign in to comment.