Hi peeps! Need help and don't even know what i need to google ๐ i'm trying to use static str as a template for format!(static str, ...) as i would in other languages. this is obviously making rustc mad ๐ what is an idiomatic way to do this in rust? example that is giving me errors:
static LEX_ERROR_UNEXPECTED_CHAR: &str = "Unexpected character {} at {}:{}!";
...
return Err(format!(LEX_ERROR_UNEXPECTED_CHAR, c, self.ln, self.col));
Compile error is:
--> src/main.rs:91:40
|
91 | return Err(format!(LEX_ERROR_UNEXPECTED_CHAR, c, self.ln, self.col));
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: you might be missing a string literal to format with
|
91 | return Err(format!("{} {} {} {}", LEX_ERROR_UNEXPECTED_CHAR, c, self.ln, self.col));
| ++++++++++++++