rust - How do I initialize a static with calls to non-static functions? -


what proper way initialize such field, if there 1 @ all?

static args: hashmap<&str, vec<u8>> = ["nonce", "gas_price", "gas_limit", "to", "value", "data"]     .iter()     .map(|i| (*i, get_random()))     .collect(); 

i error:

error[e0015]: calls in statics limited constant functions, struct , enum constructors  --> src/main.rs:3:39   | 3 |   static args: hashmap<&str, vec<u8>> = ["nonce", "gas_price", "gas_limit", "to", "value", "data"]   |  _______________________________________^ starting here... 4 | |     .iter()   | |___________^ ...ending here 


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -