I want to have a const
or static
which is a random number appended by a dot. In Java it produces what I want, but in Rust I get variety of errors
const SOME_STR: &'static str = format!("{}.", rand::random::<u64> ()).as_str();
static SOME_STR: &'static str = format!("{}.", rand::random::<u64> ()).as_str();
I get errors like
- calls in statics are limited to struct and enum constructors
- static contains unimplemented expression type
- borrowed value does not live long enough
What are my options here and what is an easy way to fix this?