Hi, I have this code :
let key = match args_vec.get(0) {
Some(&"rand") => &rand::random::<[u8; 16]>(),
Some(k) => k.as_bytes(),
None => {
msg.reply(ctx, "input a key").await?;
return Ok(())
}
};
The rust compiler complains because rand::random::<[u8; 16]>()
does not live long enough. How can I extend his lifetime so I can successfully return a slice from it?