Skip to content

Conversation

caspermeijn
Copy link
Contributor

Replace the inner description field of DecodeError from a string to an enum. The enum implements Display that produces the same string.

Split the error for Any::to_msg into DecodeAnyError. This provides better separation between prost and prost-types.

@caspermeijn caspermeijn force-pushed the decode_error branch 2 times, most recently from 257a684 to f30c252 Compare September 18, 2025 13:48
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub enum DecodeErrorKind {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want this to be either non_exhaustive or pub(crate)? I don't think we want to lock ourselves in like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this should be private

@caspermeijn
Copy link
Contributor Author

Oops, I changed the return type of a pub fn, which is not yet implemented in cargo-semver-checks. This makes the current version a breaking change.

@caspermeijn
Copy link
Contributor Author

Oops, I changed the return type of a pub fn, which is not yet implemented in cargo-semver-checks. This makes the current version a breaking change.

I reverted the return type change. I created a doc(hidden) function for creating the error in the prost_types::any module. A separate breaking PR will split the types.

Replace the inner `description` field of `DecodeError` from a string to an enum. The enum implements `Display` that produces the same string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants