Skip to content

Commit

Permalink
update typify; fix some nits (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahl authored Dec 24, 2024
1 parent cb9bf78 commit bcf29e1
Show file tree
Hide file tree
Showing 29 changed files with 4,839 additions and 4,490 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions progenitor-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ expectorate = { workspace = true }
futures = { workspace = true }
http = { workspace = true }
hyper = { workspace = true }
progenitor-client = { workspace = true }
reqwest = { workspace = true }
rustfmt-wrapper = { workspace = true }
semver = { workspace = true }
serde_yaml = { workspace = true }
tokio = { workspace = true }

progenitor-client.path = "../progenitor-client"
22 changes: 14 additions & 8 deletions progenitor-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ impl Generator {

let version_str = &spec.info.version;

// The allow(unused_imports) on the `pub use` is necessary with Rust 1.76+, in case the
// generated file is not at the top level of the crate.
// The allow(unused_imports) on the `pub use` is necessary with Rust
// 1.76+, in case the generated file is not at the top level of the
// crate.

let file = quote! {
// Re-export ResponseValue and Error since those are used by the
Expand Down Expand Up @@ -512,11 +513,13 @@ impl Generator {
.map(|method| self.positional_method(method, has_inner))
.collect::<Result<Vec<_>>>()?;

// The allow(unused_imports) on the `pub use` is necessary with Rust 1.76+, in case the
// generated file is not at the top level of the crate.
// The allow(unused_imports) on the `pub use` is necessary with Rust
// 1.76+, in case the generated file is not at the top level of the
// crate.

let out = quote! {
#[allow(clippy::all)]
#[allow(elided_named_lifetimes)]
impl Client {
#(#methods)*
}
Expand Down Expand Up @@ -590,8 +593,9 @@ impl Generator {

let (traits_and_impls, trait_preludes) = self.builder_tags(input_methods, &tag_info);

// The allow(unused_imports) on the `pub use` is necessary with Rust 1.76+, in case the
// generated file is not at the top level of the crate.
// The allow(unused_imports) on the `pub use` is necessary with Rust
// 1.76+, in case the generated file is not at the top level of the
// crate.

let out = quote! {
#traits_and_impls
Expand Down Expand Up @@ -631,12 +635,14 @@ impl Generator {
&self.type_space
}

/// Whether the generated client needs to use additional crates to support futures.
/// Whether the generated client needs to use additional crates to support
/// futures.
pub fn uses_futures(&self) -> bool {
self.uses_futures
}

/// Whether the generated client needs to use additional crates to support websockets.
/// Whether the generated client needs to use additional crates to support
/// websockets.
pub fn uses_websockets(&self) -> bool {
self.uses_websockets
}
Expand Down
2 changes: 1 addition & 1 deletion progenitor-impl/tests/output/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ uuid = { features = ["serde", "v4"], version = "1" }

[lints.rust]
unused_imports = "allow"
unused_variables= "allow"
unused_variables = "allow"

[lints.clippy]
needless_lifetimes = "allow"
Expand Down
Loading

0 comments on commit bcf29e1

Please sign in to comment.