Say I have code like this:
#[deprecated = "string"]
fn foo() {}
but I want "string" to be defined once and re-used in many places. So far the only way I've found is to define a macro:
macro_rules! my_string { () => { "string" } };
#[deprecated = my_string!()]
fn foo() {}
but it seems as if there should be a simpler way. Can I somehow directly use a string literal in an attribute like that?