spawn requires that the closure you pass it has 'static lifetime since the thread can keep running upto the termination of the program....to borrow from shorter lived data you can look at https://doc.rust-lang.org/std/thread/fn.scope.html
That joins all spawned threads using the scope when the closure exits (and blocks the main thread until the scope call is finished - all threads are joined)
Create a scope for spawning scoped threads.