Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit a689be2

Browse files
committed
Remove unnecessary moves in closures
1 parent 5f2305a commit a689be2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

rls/src/actions/post_build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ pub struct AnalysisQueue {
232232
impl AnalysisQueue {
233233
// Create a new queue and start the worker thread.
234234
pub fn init() -> AnalysisQueue {
235-
let queue = Arc::new(Mutex::new(Vec::new()));
235+
let queue = Arc::default();
236236
let worker_thread = thread::spawn({
237237
let queue = Arc::clone(&queue);
238-
move || AnalysisQueue::run_worker_thread(queue)
238+
|| AnalysisQueue::run_worker_thread(queue)
239239
})
240240
.thread()
241241
.clone();

rls/src/build/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub(super) fn cargo(
5959
let analysis = Arc::clone(&analysis);
6060
let input_files = Arc::clone(&input_files);
6161
let out = Arc::clone(&out);
62-
move || {
62+
|| {
6363
run_cargo(
6464
compilation_cx,
6565
package_arg,

rls/src/cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fn init() -> Sender<String> {
369369
Box::new(ChannelMsgReader::new(receiver)),
370370
PrintlnOutput,
371371
);
372-
thread::spawn(move || LsService::run(service));
372+
thread::spawn(|| LsService::run(service));
373373

374374
sender
375375
.send(

0 commit comments

Comments
 (0)