Skip to content

Commit

Permalink
Merge pull request #65 from CodingAnarchy/anon-const-fix-linter-warning
Browse files Browse the repository at this point in the history
Use an anonymous const rather than a dummy name
  • Loading branch information
fdeantoni authored Jun 3, 2024
2 parents 013b030 + c630aff commit ec5a74e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions wkt-build/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use heck::{ToShoutySnakeCase, ToUpperCamelCase};
use heck::ToUpperCamelCase;
use quote::{format_ident, quote};
use std::fs::{File, OpenOptions};
use std::io::Write;
Expand Down Expand Up @@ -47,14 +47,9 @@ fn gen_trait_impl(rust_file: &mut File, package_name: &str, message_name: &str,
let type_name = message_name.to_upper_camel_case();
let type_name = format_ident!("{}", type_name);

let dummy_const = format_ident!(
"IMPL_MESSAGE_SERDE_FOR_{}",
message_name.to_shouty_snake_case()
);

let tokens = quote! {
#[allow(dead_code)]
const #dummy_const: () = {
const _: () = {
use ::prost_wkt::typetag;
#[typetag::serde(name=#type_url)]
impl ::prost_wkt::MessageSerde for #type_name {
Expand Down

0 comments on commit ec5a74e

Please sign in to comment.