-
Notifications
You must be signed in to change notification settings - Fork 18
update to prost 0.12 #154
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
base: main
Are you sure you want to change the base?
update to prost 0.12 #154
Conversation
derived Enumerations now provide their own conversion implementation from i32, so map any DecodeErrors originating from there to InvalidEncoding, and drop the manual impls that existed before. Closes: parallaxsecond#153 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
note that I have no deeper knowledge of parsec or prost, but this is currently blocking some upgrades in Debian, so I lent a hand ;) |
the build check fails because of unnecessary qualifications, see #151 (although that might bump MSRV too aggressively for your taste ;)) the MSRV check fails because the new prost requires a newer rustc - not sure what your policies are, so I'll leave that up to you! |
Thanks for the changes. The PR looks good, just waiting for #151 to be resolved so that the CI tests can be completed. |
Meanwhile, prost has went to 0.13. Here's a "delta" patch for this PR: --- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,3 +14,3 @@
[build-dependencies]
-prost-build = { version = "0.12.0", optional = true }
+prost-build = { version = "0.13.0", optional = true }
@@ -23 +23 @@
-prost = "0.12.0"
+prost = "0.13.0"
--- a/src/requests/response_status.rs
+++ b/src/requests/response_status.rs
@@ -297,2 +297,12 @@
+impl From<::prost::UnknownEnumValue> for ResponseStatus {
+ fn from(err: ::prost::UnknownEnumValue) -> Self {
+ warn!(
+ "Conversion from {} to ResponseStatus::InvalidEncoding.",
+ err
+ );
+ ResponseStatus::InvalidEncoding
+ }
+}
+
impl From<::prost::DecodeError> for ResponseStatus {
--- a/src/operations_protobuf/generated_ops/mod.rs
+++ b/src/operations_protobuf/generated_ops/mod.rs
@@ -319,3 +319,3 @@
assert_eq!(
- <::prost::DecodeError as Into<ResponseStatus>>::into(Cipher::try_from(56).unwrap_err()),
+ <::prost::UnknownEnumValue as Into<ResponseStatus>>::into(Cipher::try_from(56).unwrap_err()),
ResponseStatus::InvalidEncoding
@@ -323,3 +323,3 @@
assert_eq!(
- <::prost::DecodeError as Into<ResponseStatus>>::into(Cipher::try_from(-5).unwrap_err()),
+ <::prost::UnknownEnumValue as Into<ResponseStatus>>::into(Cipher::try_from(-5).unwrap_err()),
ResponseStatus::InvalidEncoding
@@ -327,3 +327,3 @@
assert_eq!(
- <::prost::DecodeError as Into<ResponseStatus>>::into(Hash::try_from(89).unwrap_err()),
+ <::prost::UnknownEnumValue as Into<ResponseStatus>>::into(Hash::try_from(89).unwrap_err()),
ResponseStatus::InvalidEncoding
@@ -331,3 +331,3 @@
assert_eq!(
- <::prost::DecodeError as Into<ResponseStatus>>::into(Hash::try_from(-4).unwrap_err()),
+ <::prost::UnknownEnumValue as Into<ResponseStatus>>::into(Hash::try_from(-4).unwrap_err()),
ResponseStatus::InvalidEncoding
@@ -335,3 +335,3 @@
assert_eq!(
- <::prost::DecodeError as Into<ResponseStatus>>::into(EccFamily::try_from(78).unwrap_err()),
+ <::prost::UnknownEnumValue as Into<ResponseStatus>>::into(EccFamily::try_from(78).unwrap_err()),
ResponseStatus::InvalidEncoding |
derived Enumerations now provide their own conversion implementation from i32, so map any DecodeErrors originating from there to InvalidEncoding, and drop the manual impls that existed before.
Closes: #153