rosetta icon indicating copy to clipboard operation
rosetta copied to clipboard

Cant have translation keys which are Rust keywords

Open Nutomic opened this issue 2 years ago • 1 comments

For example, mod.

--> /home/felix/workspace/lemmy/target/debug/build/lemmy_websocket-5c9ec7d2402ea26c/out/rosetta_output.rs:1:35802
|
1 | ...[allow (clippy :: match_single_binding)] pub fn mod (& self) -> & 'static str { match self { _ => "mod" } } # [allow (clippy :: match_...
|                                                    ^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers

Would be good if identifiers could be escaped, as suggested by the help message. Syntax is like let r#mod = 123;.

Nutomic avatar Jan 22 '22 12:01 Nutomic

Thanks for reporting, I'll fix that as soon as possible!

baptiste0928 avatar Jan 23 '22 10:01 baptiste0928