Relocate private size_hint module

Let's keep crate::__private for only things that *need* to be accessible
to the macro-generated code. Size_hint can be pub(crate).
This commit is contained in:
David Tolnay 2023-07-30 23:04:13 -07:00
parent 4aa54222f4
commit 5e102c4da1
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
6 changed files with 5 additions and 8 deletions

View File

@ -8,7 +8,7 @@ use crate::de::{
use crate::seed::InPlaceSeed; use crate::seed::InPlaceSeed;
#[cfg(any(feature = "std", feature = "alloc"))] #[cfg(any(feature = "std", feature = "alloc"))]
use crate::__private::size_hint; use crate::de::size_hint;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -122,6 +122,7 @@ pub mod value;
mod format; mod format;
mod ignored_any; mod ignored_any;
mod impls; mod impls;
pub(crate) mod size_hint;
mod utf8; mod utf8;
pub use self::ignored_any::IgnoredAny; pub use self::ignored_any::IgnoredAny;

View File

@ -24,8 +24,7 @@
use crate::lib::*; use crate::lib::*;
use self::private::{First, Second}; use self::private::{First, Second};
use crate::__private::size_hint; use crate::de::{self, size_hint, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use crate::de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use crate::ser; use crate::ser;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -208,12 +208,11 @@ mod content {
use crate::lib::*; use crate::lib::*;
use crate::__private::size_hint;
use crate::actually_private; use crate::actually_private;
use crate::de::value::{MapDeserializer, SeqDeserializer}; use crate::de::value::{MapDeserializer, SeqDeserializer};
use crate::de::{ use crate::de::{
self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny, self, size_hint, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected,
MapAccess, SeqAccess, Unexpected, Visitor, IgnoredAny, MapAccess, SeqAccess, Unexpected, Visitor,
}; };
/// Used from generated code to buffer the contents of the Deserializer when /// Used from generated code to buffer the contents of the Deserializer when

View File

@ -3,8 +3,6 @@ pub mod de;
#[cfg(not(no_serde_derive))] #[cfg(not(no_serde_derive))]
pub mod ser; pub mod ser;
pub mod size_hint;
// FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed. // FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed.
pub mod doc; pub mod doc;