From: Chris Morgan Date: Fri, 7 Jan 2022 04:51:50 +0000 (+1100) Subject: Tidy the alloc-gated example rustdoc syntax X-Git-Url: https://git.chrismorgan.info/verhoeff/commitdiff_plain/95453055eda4d3f730a2ce90d9fd3d61c789e9c5?hp=67417456c81ccc241cb0e7257d6ca3a955e1d29e Tidy the alloc-gated example rustdoc syntax This way it’s subjectively slightly less painful to behold, and doesn’t get marked as untested on !alloc (for good or bad). --- diff --git a/src/lib.rs b/src/lib.rs index 69fb557..251edd8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -137,13 +137,14 @@ pub trait VerhoeffMut { /// /// ## Example /// - #[cfg_attr(feature = "alloc", doc = " ```")] - #[cfg_attr(not(feature = "alloc"), doc = " ```rust,ignore")] + /// ``` + /// # #[cfg(feature = "alloc")] { /// use verhoeff::VerhoeffMut; /// let mut digits = String::from("12345"); /// digits.push_verhoeff_check_digit(); /// assert_eq!(digits, "123451"); - #[doc = " ```"] // just to keep the Vim syntax highlighter happy. Silly, huh? + /// # } + /// ``` fn push_verhoeff_check_digit(&mut self); }