Skip to content

Commit

Permalink
Export string::Utf8Error
Browse files Browse the repository at this point in the history
`ProtoStr` is a public type and it has a public
method `to_str`, however `to_str` returns a private
type `Utf8Error`, which triggers `private-interfaces` [1].

Exporting string::Utf8Error makes it possible for other
crates to wrap it in another error type and propagate
it with "?".

[1] https://doc.rust-lang.org/beta/rustc/lints/listing/warn-by-default.html#private-interfaces

PiperOrigin-RevId: 684477510
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Oct 10, 2024
1 parent cffa590 commit 29c232a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub mod __public {
pub use crate::repeated::{
ProxiedInRepeated, Repeated, RepeatedIter, RepeatedMut, RepeatedView,
};
pub use crate::string::{ProtoBytes, ProtoStr, ProtoString};
pub use crate::string::{ProtoBytes, ProtoStr, ProtoString, Utf8Error};
pub use crate::{ParseError, SerializeError};
}
pub use __public::*;
Expand Down

0 comments on commit 29c232a

Please sign in to comment.