Skip to content

Commit

Permalink
+pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Gilbert <spencer.gilbert@datadoghq.com>
  • Loading branch information
spencergilbert committed Apr 13, 2023
1 parent e01c0b8 commit a216aac
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/vector-config-macros/src/configurable_component.rs
Original file line number Diff line number Diff line change
@@ -403,21 +403,21 @@ pub fn configurable_component_impl(args: TokenStream, item: TokenStream) -> Toke
// Properly capitalize labels, accounting for some exceptions
// TODO: Replace this with an explicit requirement for a "component_human_name" or similar.
fn capitalize(s: &str) -> String {
let mut iter = s.chars();
match iter.next() {
None => String::new(),
Some(first) => {
let name = first.to_uppercase().collect::<String>() + iter.as_str();
match name.as_str() {
"Amqp" | "Aws" | "Ec2" | "Ecs" | "Gcp" | "Hec" | "Http" | "Nats" | "Nginx"
| "Sqs" => name.to_uppercase(),
"Eventstoredb" => String::from("EventStoreDB"),
"Mongodb" => String::from("MongoDB"),
"Opentelemetry" => String::from("OpenTelemetry"),
"Postgresql" => String::from("PostgreSQL"),
"Pubsub" => String::from("Pub/Sub"),
"Statsd" => String::from("StatsD"),
_ => name,
match s {
"Amqp" | "Aws" | "Ec2" | "Ecs" | "Gcp" | "Hec" | "Http" | "Nats" | "Nginx" | "Sqs" => {
s.to_uppercase()
}
"Eventstoredb" => String::from("EventStoreDB"),
"Mongodb" => String::from("MongoDB"),
"Opentelemetry" => String::from("OpenTelemetry"),
"Postgresql" => String::from("PostgreSQL"),
"Pubsub" => String::from("Pub/Sub"),
"Statsd" => String::from("StatsD"),
_ => {
let mut iter = s.chars();
match iter.next() {
None => String::new(),
Some(first) => first.to_uppercase().collect::<String>() + iter.as_str(),
}
}
}

0 comments on commit a216aac

Please sign in to comment.