The error I'm getting: |siv_X|
^^^ may outlive borrowed value left_name
But this is impossible, as left_name has static lifetime. How to indicate in the closure that the left_name has static lifetime?
It doesn't, it's a local variable. It happens to be a reference that points to a 'static str, but it's not 'static itself.
You should therefore not take its address, likely. Try siv_X.call_on_name(left_name) instead.
If that does not work, because call_on_nameactually requires a &&str (as opposed to just a &str, which I highly doubt), then declare left_name as static LEFT_NAME: &str = "LeftName"; instead.