From fc8dd13aa284d255b79504ed4ee15a27aba6228f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 9 Sep 2023 12:15:00 -0700 Subject: [PATCH] Touch up PR 1067 --- src/number.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/number.rs b/src/number.rs index f4925a0b4..6b3003f42 100644 --- a/src/number.rs +++ b/src/number.rs @@ -279,8 +279,8 @@ impl Number { } } - #[cfg(feature = "arbitrary_precision")] /// Returns the `&str` representation of the `Number`. + /// /// ``` /// # use serde_json::Number; /// for value in [ @@ -294,6 +294,8 @@ impl Number { /// let number: Number = serde_json::from_str(value).unwrap(); /// assert_eq!(number.as_str(), value); /// } + /// ``` + #[cfg(feature = "arbitrary_precision")] pub fn as_str(&self) -> &str { &self.n }