The closure of thread::spawn
moves listener1
to handle_listener
. handle_listener
doesn't move ot further so when handle_listener
returns listener
gets dropped.
The closure of thread::spawn
moves listener1
to handle_listener
. handle_listener
doesn't move ot further so when handle_listener
returns listener
gets dropped.