From 33f239d35508b9ca451b2a7a0a37797201f39d44 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 18 Aug 2023 06:28:08 -0700 Subject: [PATCH] Use a glob import in protobuf.rs This removes the need to duplicate individual imports from shared.rs and possibly forget something. PiperOrigin-RevId: 558128872 --- rust/protobuf.rs | 4 +--- rust/shared.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rust/protobuf.rs b/rust/protobuf.rs index ac4c4e0b2c..beb30ad5f4 100644 --- a/rust/protobuf.rs +++ b/rust/protobuf.rs @@ -41,6 +41,4 @@ use protobuf_cpp as kernel; #[cfg(upb_kernel)] use protobuf_upb as kernel; -pub use kernel::{ - BytesMut, Mut, MutProxy, ParseError, Proxied, ProxiedWithPresence, View, ViewProxy, -}; +pub use kernel::__public::*; diff --git a/rust/shared.rs b/rust/shared.rs index 0e8b7d2301..dfee341a5f 100644 --- a/rust/shared.rs +++ b/rust/shared.rs @@ -36,9 +36,17 @@ use std::fmt; -pub use optional::{AbsentField, FieldEntry, Optional, PresentField}; -pub use proxied::{Mut, MutProxy, Proxied, ProxiedWithPresence, SettableValue, View, ViewProxy}; -pub use string::{BytesMut, ProtoStr}; +/// Everything in `__public` is re-exported in `protobuf.rs`. +/// These are the items protobuf users can access directly. +#[doc(hidden)] +pub mod __public { + pub use crate::optional::{AbsentField, FieldEntry, Optional, PresentField}; + pub use crate::proxied::{ + Mut, MutProxy, Proxied, ProxiedWithPresence, SettableValue, View, ViewProxy, + }; + pub use crate::string::{BytesMut, ProtoStr}; +} +pub use __public::*; /// Everything in `__internal` is allowed to change without it being considered /// a breaking change for the protobuf library. Nothing in here should be