tauri-apps / muda

Menu Utilities for Desktop Applications in Rust.
Apache License 2.0
246 stars 25 forks source link

`from_cargo_metadata` pulling from muda crate instead of binary #207

Closed PrimmR closed 1 month ago

PrimmR commented 1 month ago

Whenever I use the from_cargo_metadata method of AboutMetadata I get the details of the muda crate instead of the binary the method is being called from, which I assume is not the intended behaviour.

This could be fixed by changing the env! macro to std::env::var, as the latter means the environment variable is checked at runtime, so they hold the details of the binary, not the muda crate.

FabianLars commented 1 month ago

std::env::var won't work outside of cargo run either. :/

amrbashir commented 1 month ago

I guess the only fix to this, is to convert it into a macro:

let metadata = about_metadata::from_cargo_metadata!();
FabianLars commented 1 month ago

tbh i wouldn't even mind removing it completely. The current impl is imo small enough to just be an example / something that devs can include in their own code 🤷