diff --git a/snippets/rust.snippets b/snippets/rust.snippets index 5a64e76..77e5132 100644 --- a/snippets/rust.snippets +++ b/snippets/rust.snippets @@ -161,8 +161,12 @@ snippet ss "static string declaration" snippet stat "static item declaration" static ${1}: ${2:usize} = ${0}; # Concurrency -snippet spawn "spawn a task or thread" - spawn(proc() { +snippet scoped "spawn a scoped thread" + thread::scoped(${1:move }|| { + ${0} + }); +snippet spawn "spawn a thread" + thread::spawn(${1:move }|| { ${0} }); snippet chan "Declare (Sender, Receiver) pair of asynchronous channel()"