From 373f315a59ec2b4045553612fd50210657e83e08 Mon Sep 17 00:00:00 2001 From: fdeantoni Date: Tue, 10 Jan 2023 15:12:55 +0100 Subject: [PATCH] Bumped version to 0.4.0 and removed deprecated methods. --- Cargo.toml | 2 +- example/Cargo.toml | 2 +- src/lib.rs | 3 --- wkt-build/Cargo.toml | 2 +- wkt-build/src/lib.rs | 6 ------ wkt-types/Cargo.toml | 6 +++--- wkt-types/src/pbany.rs | 7 ------- wkt-types/tests/pbany_test.rs | 7 ------- 8 files changed, 6 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 90f6710..4424d9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prost-wkt" -version = "0.3.5" +version = "0.4.0" authors = ["fdeantoni "] license = "Apache-2.0" repository = "https://github.com/fdeantoni/prost-wkt" diff --git a/example/Cargo.toml b/example/Cargo.toml index 7e136ff..378bf9e 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prost-wkt-example" -version = "0.3.5" +version = "0.4.0" authors = ["fdeantoni "] edition = "2021" diff --git a/src/lib.rs b/src/lib.rs index d1b8116..0186a6e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,9 +14,6 @@ pub trait MessageSerde: prost::Message + std::any::Any { /// Creates a new instance of this message using the protobuf encoded data fn new_instance(&self, data: Vec) -> Result, prost::DecodeError>; /// Returns the encoded protobuf message as bytes - #[deprecated(since = "0.3.0", note = "please use `try_encoded` instead")] - fn encoded(&self) -> Vec; - /// Returns the encoded protobuf message as bytes fn try_encoded(&self) -> Result, prost::EncodeError>; } diff --git a/wkt-build/Cargo.toml b/wkt-build/Cargo.toml index 466bede..9ffdcd7 100644 --- a/wkt-build/Cargo.toml +++ b/wkt-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prost-wkt-build" -version = "0.3.5" +version = "0.4.0" authors = ["fdeantoni "] license = "Apache-2.0" repository = "https://github.com/fdeantoni/prost-wkt" diff --git a/wkt-build/src/lib.rs b/wkt-build/src/lib.rs index f9ce4cd..c576f0a 100644 --- a/wkt-build/src/lib.rs +++ b/wkt-build/src/lib.rs @@ -73,12 +73,6 @@ fn gen_trait_impl(rust_file: &mut File, package_name: &str, message_name: &str, let erased: Box = Box::new(target); Ok(erased) } - fn encoded(&self) -> Vec { - let mut buf = Vec::new(); - buf.reserve(::prost::Message::encoded_len(self)); - ::prost::Message::encode(self, &mut buf).expect("Failed to encode message"); - buf - } fn try_encoded(&self) -> Result, ::prost::EncodeError> { let mut buf = Vec::new(); buf.reserve(::prost::Message::encoded_len(self)); diff --git a/wkt-types/Cargo.toml b/wkt-types/Cargo.toml index f658120..4995c7e 100644 --- a/wkt-types/Cargo.toml +++ b/wkt-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prost-wkt-types" -version = "0.3.5" +version = "0.4.0" authors = ["fdeantoni "] license = "Apache-2.0" repository = "https://github.com/fdeantoni/prost-wkt" @@ -19,7 +19,7 @@ default = ["std"] std = [] [dependencies] -prost-wkt = { version = "0.3.5", path = ".." } +prost-wkt = { version = "0.4.0", path = ".." } prost = "0.11.5" serde = "1.0" serde_json = "1.0" @@ -30,5 +30,5 @@ chrono = { version = "0.4", default-features = false, features = ["serde"] } prost = "0.11.5" prost-types = "0.11.5" prost-build = "0.11.5" -prost-wkt-build = { version = "0.3.5", path = "../wkt-build" } +prost-wkt-build = { version = "0.4.0", path = "../wkt-build" } regex = "1" diff --git a/wkt-types/src/pbany.rs b/wkt-types/src/pbany.rs index e79c7d1..4c46183 100644 --- a/wkt-types/src/pbany.rs +++ b/wkt-types/src/pbany.rs @@ -194,13 +194,6 @@ mod tests { Ok(erased) } - fn encoded(&self) -> Vec { - let mut buf = Vec::new(); - buf.reserve(Message::encoded_len(self)); - Message::encode(self, &mut buf).unwrap(); - buf - } - fn try_encoded(&self) -> Result, EncodeError> { let mut buf = Vec::new(); buf.reserve(Message::encoded_len(self)); diff --git a/wkt-types/tests/pbany_test.rs b/wkt-types/tests/pbany_test.rs index f3deb42..15d04ea 100644 --- a/wkt-types/tests/pbany_test.rs +++ b/wkt-types/tests/pbany_test.rs @@ -43,13 +43,6 @@ impl prost_wkt::MessageSerde for Foo { Ok(erased) } - fn encoded(&self) -> Vec { - let mut buf = Vec::new(); - buf.reserve(Message::encoded_len(self)); - Message::encode(self, &mut buf).unwrap(); - buf - } - fn try_encoded(&self) -> Result, EncodeError> { let mut buf = Vec::new(); buf.reserve(Message::encoded_len(self));