Skip to content

Commit

Permalink
Relocate private size_hint module
Browse files Browse the repository at this point in the history
Let's keep crate::__private for only things that *need* to be accessible
to the macro-generated code. Size_hint can be pub(crate).
  • Loading branch information
dtolnay committed Aug 3, 2023
1 parent 4aa5422 commit 5e102c4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::de::{
use crate::seed::InPlaceSeed;

#[cfg(any(feature = "std", feature = "alloc"))]
use crate::__private::size_hint;
use crate::de::size_hint;

////////////////////////////////////////////////////////////////////////////////

Expand Down
1 change: 1 addition & 0 deletions serde/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub mod value;
mod format;
mod ignored_any;
mod impls;
pub(crate) mod size_hint;
mod utf8;

pub use self::ignored_any::IgnoredAny;
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions serde/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
use crate::lib::*;

use self::private::{First, Second};
use crate::__private::size_hint;
use crate::de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use crate::de::{self, size_hint, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use crate::ser;

////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 2 additions & 3 deletions serde/src/private/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,11 @@ mod content {

use crate::lib::*;

use crate::__private::size_hint;
use crate::actually_private;
use crate::de::value::{MapDeserializer, SeqDeserializer};
use crate::de::{
self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny,
MapAccess, SeqAccess, Unexpected, Visitor,
self, size_hint, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected,
IgnoredAny, MapAccess, SeqAccess, Unexpected, Visitor,
};

/// Used from generated code to buffer the contents of the Deserializer when
Expand Down
2 changes: 0 additions & 2 deletions serde/src/private/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ pub mod de;
#[cfg(not(no_serde_derive))]
pub mod ser;

pub mod size_hint;

// FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed.
pub mod doc;

Expand Down

0 comments on commit 5e102c4

Please sign in to comment.