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