Skip to content

Commit

Permalink
Merge pull request #104 from Kuadrant/clippy
Browse files Browse the repository at this point in the history
Clippy
  • Loading branch information
alexsnaps authored Aug 16, 2022
2 parents a1c57a7 + 73bb84b commit 205d8be
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 2,364 deletions.
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

0 comments on commit 205d8be

Please sign in to comment.