Skip to content

Commit

Permalink
Update examples. Replace deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Jan 14, 2023
1 parent bff90d0 commit f374de4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/channel.rs
Expand Up @@ -366,7 +366,7 @@ impl Channel {
/// use chrono::{TimeZone, Utc};
///
/// let mut channel = Channel::default();
/// channel.set_pub_date(Utc.ymd(2017, 1, 1).and_hms(12, 0, 0).to_rfc2822());
/// channel.set_pub_date(Utc.with_ymd_and_hms(2017, 1, 1, 12, 0, 0).unwrap().to_rfc2822());
/// assert_eq!(channel.pub_date(), Some("Sun, 01 Jan 2017 12:00:00 +0000"));
/// # }
/// ```
Expand Down Expand Up @@ -412,7 +412,7 @@ impl Channel {
/// use chrono::{TimeZone, Utc};
///
/// let mut channel = Channel::default();
/// channel.set_last_build_date(Utc.ymd(2017, 1, 1).and_hms(12, 0, 0).to_rfc2822());
/// channel.set_last_build_date(Utc.with_ymd_and_hms(2017, 1, 1, 12, 0, 0).unwrap().to_rfc2822());
/// assert_eq!(channel.last_build_date(), Some("Sun, 01 Jan 2017 12:00:00 +0000"));
/// # }
/// ```
Expand Down
4 changes: 2 additions & 2 deletions src/item.rs
Expand Up @@ -374,10 +374,10 @@ impl Item {
/// use chrono::{FixedOffset, TimeZone, Utc};
///
/// let mut item = Item::default();
/// item.set_pub_date(Utc.ymd(2017, 1, 1).and_hms(12, 0, 0).to_rfc2822());
/// item.set_pub_date(Utc.with_ymd_and_hms(2017, 1, 1, 12, 0, 0).unwrap().to_rfc2822());
/// assert_eq!(item.pub_date(), Some("Sun, 01 Jan 2017 12:00:00 +0000"));
///
/// item.set_pub_date(FixedOffset::east(2 * 3600).ymd(2017, 1, 1).and_hms(12, 0, 0).to_rfc2822());
/// item.set_pub_date(FixedOffset::east_opt(2 * 3600).unwrap().with_ymd_and_hms(2017, 1, 1, 12, 0, 0).unwrap().to_rfc2822());
/// assert_eq!(item.pub_date(), Some("Sun, 01 Jan 2017 12:00:00 +0200"));
/// # }
/// ```
Expand Down

0 comments on commit f374de4

Please sign in to comment.