orph3usLyre / muddy-waters

A static string obfuscation library for rust projects
Apache License 2.0
73 stars 3 forks source link

support env!() #27

Open GGORG0 opened 19 hours ago

GGORG0 commented 19 hours ago

Hi, I'd like to obfuscate a string from the env!() macro. It returns a &'static str, so this shouldn't be a problem, right?

It is.

#[muddy]
static BACKEND_ENDPOINT: &str = env!("BACKEND_ENDPOINT");

error: Expression must be of type &'static str

orph3usLyre commented 5 hours ago

The error is unfortunately not very helpful here, since the macro really only expects string literals. Thanks for bringing this up.

However, I'm pretty sure that what you're attempting should be possible - I'll check it out!