Skip to content

Commit

Permalink
Bumped version to 0.4.0 and removed deprecated methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdeantoni committed Jan 10, 2023
1 parent f50b938 commit 373f315
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prost-wkt"
version = "0.3.5"
version = "0.4.0"
authors = ["fdeantoni <fdeantoni@gmail.com>"]
license = "Apache-2.0"
repository = "https://github.com/fdeantoni/prost-wkt"
Expand Down
2 changes: 1 addition & 1 deletion example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prost-wkt-example"
version = "0.3.5"
version = "0.4.0"
authors = ["fdeantoni <fdeantoni@gmail.com>"]
edition = "2021"

Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>) -> Result<Box<dyn MessageSerde>, prost::DecodeError>;
/// Returns the encoded protobuf message as bytes
#[deprecated(since = "0.3.0", note = "please use `try_encoded` instead")]
fn encoded(&self) -> Vec<u8>;
/// Returns the encoded protobuf message as bytes
fn try_encoded(&self) -> Result<Vec<u8>, prost::EncodeError>;
}

Expand Down
2 changes: 1 addition & 1 deletion wkt-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prost-wkt-build"
version = "0.3.5"
version = "0.4.0"
authors = ["fdeantoni <fdeantoni@gmail.com>"]
license = "Apache-2.0"
repository = "https://github.com/fdeantoni/prost-wkt"
Expand Down
6 changes: 0 additions & 6 deletions wkt-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ fn gen_trait_impl(rust_file: &mut File, package_name: &str, message_name: &str,
let erased: Box<dyn ::prost_wkt::MessageSerde> = Box::new(target);
Ok(erased)
}
fn encoded(&self) -> Vec<u8> {
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<Vec<u8>, ::prost::EncodeError> {
let mut buf = Vec::new();
buf.reserve(::prost::Message::encoded_len(self));
Expand Down
6 changes: 3 additions & 3 deletions wkt-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prost-wkt-types"
version = "0.3.5"
version = "0.4.0"
authors = ["fdeantoni <fdeantoni@gmail.com>"]
license = "Apache-2.0"
repository = "https://github.com/fdeantoni/prost-wkt"
Expand All @@ -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"
Expand All @@ -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"
7 changes: 0 additions & 7 deletions wkt-types/src/pbany.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@ mod tests {
Ok(erased)
}

fn encoded(&self) -> Vec<u8> {
let mut buf = Vec::new();
buf.reserve(Message::encoded_len(self));
Message::encode(self, &mut buf).unwrap();
buf
}

fn try_encoded(&self) -> Result<Vec<u8>, EncodeError> {
let mut buf = Vec::new();
buf.reserve(Message::encoded_len(self));
Expand Down
7 changes: 0 additions & 7 deletions wkt-types/tests/pbany_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ impl prost_wkt::MessageSerde for Foo {
Ok(erased)
}

fn encoded(&self) -> Vec<u8> {
let mut buf = Vec::new();
buf.reserve(Message::encoded_len(self));
Message::encode(self, &mut buf).unwrap();
buf
}

fn try_encoded(&self) -> Result<Vec<u8>, EncodeError> {
let mut buf = Vec::new();
buf.reserve(Message::encoded_len(self));
Expand Down

0 comments on commit 373f315

Please sign in to comment.