Skip to content

Commit

Permalink
Merge pull request #32 from gorzell/prost-0.11.5
Browse files Browse the repository at this point in the history
Upgrade to prost 0.11.5.
  • Loading branch information
fdeantoni authored Jan 8, 2023
2 parents 62fbaa1 + cb18829 commit e6c624a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions wkt-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ std = []

[dependencies]
prost-wkt = { version = "0.3.4", path = ".." }
prost = "0.11.2"
prost = "0.11.5"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
chrono = { version = "0.4", default-features = false, features = ["serde"] }

[build-dependencies]
prost = "0.11.2"
prost-types = "0.11.2"
prost-build = "0.11.2"
prost = "0.11.5"
prost-types = "0.11.5"
prost-build = "0.11.5"
prost-wkt-build = { version = "0.3.4", path = "../wkt-build" }
regex = "1"
12 changes: 8 additions & 4 deletions wkt-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ use prost_types::FileDescriptorSet;

use regex::Regex;


fn main() {

let dir = PathBuf::from(env::var("OUT_DIR").unwrap());
process_prost_pbtime(&dir);

Expand Down Expand Up @@ -64,7 +62,10 @@ fn process_prost_types_lib(dir: &Path) {
}

let file = dir.join("prost_snippet.rs");
File::create(file).unwrap().write_all(string.as_bytes()).unwrap();
File::create(file)
.unwrap()
.write_all(string.as_bytes())
.unwrap();
}

fn process_prost_types_datetime(dir: &Path) {
Expand All @@ -80,5 +81,8 @@ fn process_prost_types_datetime(dir: &Path) {
let re = Regex::new(r"crate").unwrap();
let result = re.replace_all(&string, "super").to_string();
let file = dir.join("datetime.rs");
File::create(file).unwrap().write_all(result.as_bytes()).unwrap();
File::create(file)
.unwrap()
.write_all(result.as_bytes())
.unwrap();
}
12 changes: 6 additions & 6 deletions wkt-types/src/pbstruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ mod tests {
},
"list": []
}"#;
let sj: serde_json::Value = serde_json::from_str(data).unwrap();
let pj: Value = serde_json::from_value(sj.clone()).unwrap();
println!("prost_wkt_types Value: {:?}", pj);
let string: String = serde_json::to_string(&pj).unwrap();
let back: serde_json::Value = serde_json::from_str(&string).unwrap();
assert_eq!(sj, back);
let sj: serde_json::Value = serde_json::from_str(data).unwrap();
let pj: Value = serde_json::from_value(sj.clone()).unwrap();
println!("prost_wkt_types Value: {:?}", pj);
let string: String = serde_json::to_string(&pj).unwrap();
let back: serde_json::Value = serde_json::from_str(&string).unwrap();
assert_eq!(sj, back);
}
}
1 change: 0 additions & 1 deletion wkt-types/src/pbtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use serde::ser::{Serialize, Serializer};
include!(concat!(env!("OUT_DIR"), "/pbtime/google.protobuf.rs"));
include!(concat!(env!("OUT_DIR"), "/prost_snippet.rs"));


/// Converts chrono's `NaiveDateTime` to `Timestamp`..
impl From<NaiveDateTime> for Timestamp {
fn from(dt: NaiveDateTime) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion wkt-types/tests/pbany_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl prost_wkt::MessageSerde for Foo {
}
}

::prost_wkt::inventory::submit!{
::prost_wkt::inventory::submit! {
::prost_wkt::MessageSerdeDecoderEntry {
type_url: "type.googleapis.com/any.test.Foo",
decoder: |buf: &[u8]| {
Expand Down

0 comments on commit e6c624a

Please sign in to comment.