mirror of
https://github.com/chronotope/chrono.git
synced 2025-09-29 22:11:59 +00:00

There's no pretty way of gating doctests contingent on cfg presence/absense so this is kind of ugly. First, a doc comment `///` is converted into its equivalent `#[doc(...)]`, which is then converted into a conditional rust attribute via `#[cfg_attr(...)]`. We need two of these, one to ignore the tests if the cfg predicate isn't met and another to indicate the start of a code block and enable testing + syntax highlighting.