Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Apr 6, 2023
1 parent 699d5d9 commit 9abfd6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ impl DateTime<FixedOffset> {
///
/// Note that this method *requires a timezone* in the string. See
/// [`NaiveDateTime::parse_from_str`]
/// for a version that does not require a timezone in the to-be-parsed str.
/// for a version that does not require a timezone in `s`. The returned [`DateTime`] value will
/// have a [`FixedOffset`] reflecting the parsed timezone.
///
/// # Example
///
Expand All @@ -609,12 +610,14 @@ impl DateTime<FixedOffset> {
/// slice with the remaining portion of the string.
///
/// Note that this method *requires a timezone* in the input string. See
/// [`NaiveDateTime::parse_from_str`](./naive/struct.NaiveDateTime.html#method.parse_from_str)
/// for a version that does not require a timezone in the to-be-parsed str. The returned
/// [`DateTime`] value will have a [`FixedOffset`] reflecting the parsed timezone.
/// [`NaiveDateTime::parse_and_remainder`] for a version that does not
/// require a timezone in `s`. The returned [`DateTime`] value will have a [`FixedOffset`]
/// reflecting the parsed timezone.
///
/// See the [`format::strftime` module](./format/strftime/index.html) for supported format
/// sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
pub fn parse_and_remainder<'a>(
s: &'a str,
fmt: &str,
Expand Down
2 changes: 2 additions & 0 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ impl NaiveDate {
/// the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
pub fn parse_and_remainder<'a>(s: &'a str, fmt: &str) -> ParseResult<(NaiveDate, &'a str)> {
let mut parsed = Parsed::new();
let remainder = parse_and_remainder(&mut parsed, s, StrftimeItems::new(fmt))?;
Expand Down
2 changes: 2 additions & 0 deletions src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ impl NaiveDateTime {
/// slice with the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
pub fn parse_and_remainder<'a>(s: &'a str, fmt: &str) -> ParseResult<(NaiveDateTime, &'a str)> {
let mut parsed = Parsed::new();
let remainder = parse_and_remainder(&mut parsed, s, StrftimeItems::new(fmt))?;
Expand Down
2 changes: 2 additions & 0 deletions src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ impl NaiveTime {
/// the remaining portion of the string.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// on the supported escape sequences.
///
/// Similar to [`parse_from_str`](#method.parse_from_str).
pub fn parse_and_remainder<'a>(s: &'a str, fmt: &str) -> ParseResult<(NaiveTime, &'a str)> {
let mut parsed = Parsed::new();
let remainder = parse_and_remainder(&mut parsed, s, StrftimeItems::new(fmt))?;
Expand Down

0 comments on commit 9abfd6b

Please sign in to comment.