mirror of
https://github.com/serde-rs/json.git
synced 2025-10-01 15:02:37 +00:00
Adopt pub(crate)
This commit is contained in:
parent
17d9a5ea9b
commit
97f87f2587
@ -96,9 +96,7 @@ macro_rules! overflow {
|
||||
};
|
||||
}
|
||||
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
pub enum ParserNumber {
|
||||
pub(crate) enum ParserNumber {
|
||||
F64(f64),
|
||||
U64(u64),
|
||||
I64(i64),
|
||||
|
12
src/error.rs
12
src/error.rs
@ -175,9 +175,7 @@ struct ErrorImpl {
|
||||
column: usize,
|
||||
}
|
||||
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
pub enum ErrorCode {
|
||||
pub(crate) enum ErrorCode {
|
||||
/// Catchall for syntax error messages
|
||||
Message(Box<str>),
|
||||
|
||||
@ -252,10 +250,8 @@ pub enum ErrorCode {
|
||||
}
|
||||
|
||||
impl Error {
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn syntax(code: ErrorCode, line: usize, column: usize) -> Self {
|
||||
pub(crate) fn syntax(code: ErrorCode, line: usize, column: usize) -> Self {
|
||||
Error {
|
||||
err: Box::new(ErrorImpl {
|
||||
code: code,
|
||||
@ -280,10 +276,8 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn fix_position<F>(self, f: F) -> Self
|
||||
pub(crate) fn fix_position<F>(self, f: F) -> Self
|
||||
where
|
||||
F: FnOnce(ErrorCode) -> Error,
|
||||
{
|
||||
|
@ -13,9 +13,7 @@ use crate::error::ErrorCode;
|
||||
use serde::de::{IntoDeserializer, MapAccess};
|
||||
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
/// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
pub const TOKEN: &str = "$serde_json::private::Number";
|
||||
pub(crate) const TOKEN: &str = "$serde_json::private::Number";
|
||||
|
||||
/// Represents a JSON number, whether integer or floating point.
|
||||
#[derive(Clone, PartialEq)]
|
||||
@ -567,9 +565,7 @@ impl<'de, 'a> Deserializer<'de> for &'a Number {
|
||||
}
|
||||
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
pub struct NumberDeserializer {
|
||||
pub(crate) struct NumberDeserializer {
|
||||
pub number: Option<String>,
|
||||
}
|
||||
|
||||
@ -728,10 +724,8 @@ serde_if_integer128! {
|
||||
|
||||
impl Number {
|
||||
#[cfg(not(feature = "arbitrary_precision"))]
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn unexpected(&self) -> Unexpected {
|
||||
pub(crate) fn unexpected(&self) -> Unexpected {
|
||||
match self.n {
|
||||
N::PosInt(u) => Unexpected::Unsigned(u),
|
||||
N::NegInt(i) => Unexpected::Signed(i),
|
||||
@ -740,10 +734,8 @@ impl Number {
|
||||
}
|
||||
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
#[cold]
|
||||
pub fn unexpected(&self) -> Unexpected {
|
||||
pub(crate) fn unexpected(&self) -> Unexpected {
|
||||
Unexpected::Other("number")
|
||||
}
|
||||
}
|
||||
|
@ -506,16 +506,16 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq)]
|
||||
/// Not public API. Should be pub(crate).
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
pub enum State {
|
||||
Empty,
|
||||
First,
|
||||
Rest,
|
||||
}
|
||||
|
||||
/// Not public API. Should be pub(crate).
|
||||
// Not public API. Should be pub(crate).
|
||||
#[doc(hidden)]
|
||||
pub enum Compound<'a, W: 'a, F: 'a> {
|
||||
Map {
|
||||
|
Loading…
x
Reference in New Issue
Block a user