diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f1e5d81..79d71296 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/src/offset/mod.rs b/src/offset/mod.rs index 0da6bfb4..fb883ba3 100644 --- a/src/offset/mod.rs +++ b/src/offset/mod.rs @@ -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> { let mut parsed = Parsed::new(); parse(&mut parsed, s, StrftimeItems::new(fmt))?;