Skip to content

Commit

Permalink
* Modified documentation examples
Browse files Browse the repository at this point in the history
* Fixed typo in NaiveTime docs for Default
  • Loading branch information
DiD92 committed Dec 31, 2020
1 parent c601041 commit a1cbbaa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1714,16 +1714,16 @@ impl str::FromStr for NaiveDate {
}
}

/// The default for a NaiveDate is 1st of January 1970.
/// The default value for a NaiveDate is 1st of January 1970.
///
/// # Example
///
/// ~~~~
/// ```rust
/// use chrono::NaiveDate;
///
/// let default_date = NaiveDate::default();
/// assert_eq!(default_date, NaiveDate::from_ymd(1970, 1, 1));
/// ~~~~
/// ```
impl Default for NaiveDate {
fn default() -> Self {
NaiveDate::from_ymd(1970, 1, 1)
Expand Down
8 changes: 4 additions & 4 deletions src/naive/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1511,17 +1511,17 @@ impl str::FromStr for NaiveDateTime {
}
}

/// The default for a NaiveDateTime is one with epoch 0
/// that is 1st of January 1970 at 00:00:00.
/// The default value for a NaiveDateTime is one with epoch 0
/// that is, 1st of January 1970 at 00:00:00.
///
/// # Example
///
/// ~~~~
/// ```rust
/// use chrono::NaiveDateTime;
///
/// let default_date = NaiveDateTime::default();
/// assert_eq!(default_date, NaiveDateTime::from_timestamp(0, 0));
/// ~~~~
/// ```
impl Default for NaiveDateTime {
fn default() -> Self {
NaiveDateTime::from_timestamp(0, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/naive/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,16 +1341,16 @@ impl str::FromStr for NaiveTime {
}
}

/// The default for a NaiveTime is midnight, oo:oo:00 exactly.
/// The default value for a NaiveTime is midnight, 00:00:00 exactly.
///
/// # Example
///
/// ~~~~
/// ```rust
/// use chrono::NaiveTime;
///
/// let default_time = NaiveTime::default();
/// assert_eq!(default_time, NaiveTime::from_hms(0, 0, 0));
/// ~~~~
/// ```
impl Default for NaiveTime {
fn default() -> Self {
NaiveTime::from_hms(0, 0, 0)
Expand Down

0 comments on commit a1cbbaa

Please sign in to comment.