Skip to content

Remove actually_private::T #2939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025
Merged

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Jun 6, 2025

This sounds like a change we could do on master and consider in isolation from this PR

As posted by @oli-obk in #2608 (comment), this PR removes actually_private::T type from signature of the hidden Deserializer::__deserialize_content method, like Visitor::__private_visit_untagged_option does not have such guard:

serde/serde/src/de/mod.rs

Lines 1679 to 1687 in 2130ba5

// Used when deserializing a flattened Option field. Not public API.
#[doc(hidden)]
fn __private_visit_untagged_option<D>(self, _: D) -> Result<Self::Value, ()>
where
D: Deserializer<'de>,
{
Err(())
}
}

This guard just makes life harder in some cases without real benefits. If you use private API you already understand consequences and them can be totally acceptable, especially if you depend on the specific version

Mingun added 2 commits June 6, 2025 10:39
It just makes life harder in some cases without any benefits
@oli-obk oli-obk added this pull request to the merge queue Jun 6, 2025
@oli-obk
Copy link
Member

oli-obk commented Jun 6, 2025

Thanks!

Merged via the queue into serde-rs:master with commit babafa5 Jun 6, 2025
14 checks passed
@Mingun Mingun deleted the remove-actually-private branch June 6, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants