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

Commit e46712c

Browse files
committed
Prefer Option::copied
1 parent 41b03db commit e46712c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rls/src/lsp_data.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,17 +326,17 @@ impl ClientCapabilities {
326326
.and_then(|doc| doc.completion.as_ref())
327327
.and_then(|comp| comp.completion_item.as_ref())
328328
.and_then(|item| item.snippet_support.as_ref())
329-
.unwrap_or(&false)
330-
.to_owned();
329+
.copied()
330+
.unwrap_or(false);
331331

332332
let related_information_support = params
333333
.capabilities
334334
.text_document
335335
.as_ref()
336336
.and_then(|doc| doc.publish_diagnostics.as_ref())
337337
.and_then(|diag| diag.related_information.as_ref())
338-
.unwrap_or(&false)
339-
.to_owned();
338+
.copied()
339+
.unwrap_or(false);
340340

341341
ClientCapabilities { code_completion_has_snippet_support, related_information_support }
342342
}

0 commit comments

Comments
 (0)