Skip to content

Commit

Permalink
Touch up PR 1067
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 9, 2023
1 parent 028b643 commit fc8dd13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ impl Number {
}
}

#[cfg(feature = "arbitrary_precision")]
/// Returns the `&str` representation of the `Number`.
///
/// ```
/// # use serde_json::Number;
/// for value in [
Expand All @@ -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
}
Expand Down

0 comments on commit fc8dd13

Please sign in to comment.