Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy #104

Merged
merged 3 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions limitador-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ fn main() -> Result<(), Box<dyn Error>> {
}

fn generate_protobuf() -> Result<(), Box<dyn Error>> {
tonic_build::configure()
.build_server(true)
.out_dir("src/envoy_rls/protobufs")
.compile(
&["envoy/service/ratelimit/v3/rls.proto"],
&[
"vendor/protobufs/data-plane-api",
"vendor/protobufs/protoc-gen-validate",
"vendor/protobufs/xds",
],
)?;
tonic_build::configure().build_server(true).compile(
&["envoy/service/ratelimit/v3/rls.proto"],
&[
"vendor/protobufs/data-plane-api",
"vendor/protobufs/protoc-gen-validate",
"vendor/protobufs/xds",
],
)?;
Ok(())
}

Expand Down
36 changes: 15 additions & 21 deletions limitador-server/src/envoy_rls/envoy_types.rs
Original file line number Diff line number Diff line change
@@ -1,54 +1,48 @@
#[path = "protobufs"]
pub mod envoy {
#[path = "."]
pub mod config {
#[path = "."]
pub mod core {
#[path = "envoy.config.core.v3.rs"]
// clippy will barf on protobuff generated code for enum variants in
// v3::socket_option::SocketState, so allow this lint
#[allow(clippy::enum_variant_names, clippy::derive_partial_eq_without_eq)]
pub mod v3;
pub mod v3 {
tonic::include_proto!("envoy.config.core.v3");
}
}
}

#[path = "."]
pub mod extensions {
#[path = "."]
pub mod common {
#[path = "."]
pub mod ratelimit {
#[path = "envoy.extensions.common.ratelimit.v3.rs"]
#[allow(clippy::derive_partial_eq_without_eq)]
pub mod v3;
pub mod v3 {
tonic::include_proto!("envoy.extensions.common.ratelimit.v3");
}
}
}
}

#[path = "."]
pub mod r#type {
#[path = "envoy.r#type.v3.rs"]
#[allow(clippy::derive_partial_eq_without_eq)]
pub mod v3;
pub mod v3 {
tonic::include_proto!("envoy.r#type.v3");
}
}

#[path = "."]
pub mod service {
#[path = "."]
pub mod ratelimit {
#[path = "envoy.service.ratelimit.v3.rs"]
#[allow(clippy::derive_partial_eq_without_eq)]
pub mod v3;
pub mod v3 {
tonic::include_proto!("envoy.service.ratelimit.v3");
}
}
}
}

#[path = "protobufs"]
pub mod xds {
#[path = "."]
pub mod core {
#[path = "xds.core.v3.rs"]
#[allow(clippy::derive_partial_eq_without_eq)]
pub mod v3;
pub mod v3 {
tonic::include_proto!("xds.core.v3");
}
}
}

This file was deleted.

Loading