Skip to content

Commit

Permalink
Removed the request dependency which is no longer
Browse files Browse the repository at this point in the history
needed, updated the convert_case dependency to 0.5,
and performed minor code cleanup of build.rs.
  • Loading branch information
fdeantoni committed May 29, 2022
1 parent 08f3487 commit 69b7694
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wkt-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ prost = "0.10.0"
prost-types = "0.10.0"
prost-build = "0.10.0"
quote = "1.0"
convert_case = "0.4"
convert_case = "0.5"
3 changes: 3 additions & 0 deletions wkt-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ pub fn add_serde(out: PathBuf, descriptor: FileDescriptorSet) {
}
}

// This method uses the `convert_case` crate to properly format the message name
// to Pascal Case as the prost_build::ident::{to_snake, to_upper_camel} methods
// in the `ident` module of prost_build is private.
fn gen_trait_impl(rust_file: &mut File, package_name: &str, message_name: &str, type_url: &str) {
let type_name = message_name.to_case(Case::Pascal);
let type_name = format_ident!("{}", type_name);
Expand Down
1 change: 0 additions & 1 deletion wkt-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ prost = "0.10.0"
prost-types = "0.10.0"
prost-build = "0.10"
prost-wkt-build = { version="0.3.2", path = "../wkt-build" }
reqwest = { version = "0.11", features = ["blocking"] }
4 changes: 2 additions & 2 deletions wkt-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ fn build(dir: &Path, proto: &str) {
}

fn process_prost_pbtime(dir: &Path) {
let source: String = std::fs::read_to_string("./resources/lib.rs").unwrap().parse().unwrap();
let lines: Vec<String> = source.split('\n').map(|s| s.to_string() ).collect();
let source: String = std::fs::read_to_string("./resources/lib.rs").unwrap();
let lines: Vec<&str> = source.split('\n').collect();
let selection = &lines[27..258];
let mut string = String::new();
for line in selection {
Expand Down

0 comments on commit 69b7694

Please sign in to comment.