mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-30 14:32:19 +00:00
Check that documentation builds without warnings on nightly
This should ensure that all intra-doc links are correct.
This commit is contained in:
parent
391142a64f
commit
fafea35b9e
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@ -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
|
||||
|
@ -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))?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user