I've got this code and I'm trying to have the thread I'm spawning take ownership if the arguments to this function, but for some reason, even though it isn't a reference, it is complaining about needing
'static lifetime when I try to
vagrant@ubuntu-bionic:~/git/katharostech-github/cast2gif$ cargo run --release --features cli -- -f lucky.gitignore.cast test.gitignore.gif Compiling cast2gif v0.1.0 (/home/vagrant/git/katharostech-github/cast2gif) error[E0310]: the parameter type `C` may not live long enough --> src/lib.rs:134:5 | 119 | pub fn convert_to_gif_with_progress<R, W, C>( | - help: consider adding an explicit lifetime bound `C: 'static`... ... 134 | rayon::spawn(move || progress_thread(progress_receiver, update_progress)); | ^^^^^^^^^^^^ | note: ...so that the type `[closure@src/lib.rs:134:18: 134:77 progress_receiver:flume::Receiver<types::ProgressCmd>, update_progress:C]` will meet its required lifetime bounds --> src/lib.rs:134:5 | 134 | rayon::spawn(move || progress_thread(progress_receiver, update_progress)); | ^^^^^^^^^^^^
I think that
C should be an owned
CastProgressHandler that should then be
moveed into the thread.