From 95453055eda4d3f730a2ce90d9fd3d61c789e9c5 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 7 Jan 2022 15:51:50 +1100 Subject: [PATCH] Tidy the alloc-gated example rustdoc syntax MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This way it’s subjectively slightly less painful to behold, and doesn’t get marked as untested on !alloc (for good or bad). --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } -- 2.42.0