Skip to content

Commit

Permalink
silence non-local impl definition warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrmaxmeier committed May 8, 2024
1 parent f748610 commit 208e927
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lain_derive/src/dummy.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use proc_macro2::{Ident, Span, TokenStream};

use crate::internals::attr::unraw;
use quote::quote;

/// Wraps the code in a dummy const object. See https://github.com/serde-rs/serde/issues/159#issuecomment-214002626
pub fn wrap_in_const(trait_: &str, ty: &Ident, code: TokenStream) -> TokenStream {
let dummy_const = Ident::new(
&format!("_IMPL_{}_FOR_{}", trait_, unraw(ty)),
Span::call_site(),
);
pub fn wrap_in_const(_trait_: &str, _ty: &Ident, code: TokenStream) -> TokenStream {
let dummy_const = Ident::new("_", Span::call_site());

let use_lain = quote! {
#[allow(unknown_lints)]
Expand Down

0 comments on commit 208e927

Please sign in to comment.