Check that documentation builds without warnings on nightly

This should ensure that all intra-doc links are correct.
This commit is contained in:
Brandon W Maister 2020-11-13 11:23:14 -05:00
parent 391142a64f
commit fafea35b9e
2 changed files with 24 additions and 8 deletions

View File

@ -132,3 +132,18 @@ jobs:
- name: Build static library
run: cross check --target ${{ matrix.target }}
check-docs:
runs-on: ubuntu-latest
name: Check doc links
steps:
- uses: actions/checkout@v2
- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Check docs build without warnings
env:
RUSTDOCFLAGS: '-D warnings'
run: cargo +nightly doc

View File

@ -403,16 +403,17 @@ pub trait TimeZone: Sized + Clone {
self.timestamp_opt(secs, nanos as u32).unwrap()
}
/// Parses a string with the specified format string and
/// returns a `DateTime` with the current offset.
/// See the [`format::strftime` module](../format/strftime/index.html)
/// on the supported escape sequences.
/// Parses a string with the specified format string and returns a
/// `DateTime` with the current offset.
///
/// If the format does not include offsets, the current offset is assumed;
/// otherwise the input should have a matching UTC offset.
/// See the [`::format::strftime`] module on the
/// supported escape sequences.
///
/// See also `DateTime::parse_from_str` which gives a local `DateTime`
/// with parsed `FixedOffset`.
/// If the to-be-parsed string includes an offset, it *must* match the
/// offset of the TimeZone, otherwise an error will be returned.
///
/// See also [`DateTime::parse_from_str`] which gives a [`DateTime`] with
/// parsed [`FixedOffset`].
fn datetime_from_str(&self, s: &str, fmt: &str) -> ParseResult<DateTime<Self>> {
let mut parsed = Parsed::new();
parse(&mut parsed, s, StrftimeItems::new(fmt))?;