From 981e5cd737515153d4e5320cd835c14dba532b33 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 28 Jul 2024 09:52:17 -0400 Subject: [PATCH] helix-lsp-types: Resolve clippy lints in tests --- helix-lsp-types/src/completion.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/helix-lsp-types/src/completion.rs b/helix-lsp-types/src/completion.rs index bdf60fb51..f6bf3c15d 100644 --- a/helix-lsp-types/src/completion.rs +++ b/helix-lsp-types/src/completion.rs @@ -578,20 +578,26 @@ mod tests { #[test] fn test_tag_support_deserialization() { - let mut empty = CompletionItemCapability::default(); - empty.tag_support = None; + let empty = CompletionItemCapability { + tag_support: None, + ..CompletionItemCapability::default() + }; test_deserialization(r#"{}"#, &empty); test_deserialization(r#"{"tagSupport": false}"#, &empty); - let mut t = CompletionItemCapability::default(); - t.tag_support = Some(TagSupport { value_set: vec![] }); + let t = CompletionItemCapability { + tag_support: Some(TagSupport { value_set: vec![] }), + ..CompletionItemCapability::default() + }; test_deserialization(r#"{"tagSupport": true}"#, &t); - let mut t = CompletionItemCapability::default(); - t.tag_support = Some(TagSupport { - value_set: vec![CompletionItemTag::DEPRECATED], - }); + let t = CompletionItemCapability { + tag_support: Some(TagSupport { + value_set: vec![CompletionItemTag::DEPRECATED], + }), + ..CompletionItemCapability::default() + }; test_deserialization(r#"{"tagSupport": {"valueSet": [1]}}"#, &t); }