mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
committed by
GitHub
parent
c635a0dad4
commit
ac72800fb6
5
.changes/unraw-command-key.md
Normal file
5
.changes/unraw-command-key.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-macros": patch
|
||||
---
|
||||
|
||||
Remove raw identifier (`r#`) prefix from command arguments.
|
||||
@@ -6,6 +6,7 @@ use proc_macro::TokenStream;
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::{format_ident, quote};
|
||||
use syn::{
|
||||
ext::IdentExt,
|
||||
parse::{Parse, ParseBuffer},
|
||||
parse_macro_input,
|
||||
spanned::Spanned,
|
||||
@@ -164,7 +165,7 @@ fn parse_arg(command: &Ident, arg: &FnArg, message: &Ident) -> syn::Result<Token
|
||||
|
||||
// we only support patterns that allow us to extract some sort of keyed identifier
|
||||
let mut key = match &mut arg {
|
||||
Pat::Ident(arg) => arg.ident.to_string(),
|
||||
Pat::Ident(arg) => arg.ident.unraw().to_string(),
|
||||
Pat::Wild(_) => "".into(), // we always convert to camelCase, so "_" will end up empty anyways
|
||||
Pat::Struct(s) => super::path_to_command(&mut s.path).ident.to_string(),
|
||||
Pat::TupleStruct(s) => super::path_to_command(&mut s.path).ident.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user