aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-18 12:58:10 +0000
committerAleksey Kladov <[email protected]>2021-01-18 12:58:10 +0000
commita60168e674e04d308a92ff77a6430dbe2ac3a6a1 (patch)
tree23751dbe7ce7a9039cc30768ef521897b5e4ff9a /crates/completion/src
parent1f53026997536d5f08cc0d7165aae6222b74b8c0 (diff)
Use assert_never properly
Diffstat (limited to 'crates/completion/src')
-rw-r--r--crates/completion/src/item.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs
index 0134ff219..5d91d3a5c 100644
--- a/crates/completion/src/item.rs
+++ b/crates/completion/src/item.rs
@@ -398,7 +398,9 @@ impl Builder {
398 pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { 398 pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder {
399 self.detail = detail.map(Into::into); 399 self.detail = detail.map(Into::into);
400 if let Some(detail) = &self.detail { 400 if let Some(detail) = &self.detail {
401 assert_never!(detail.contains('\n'), "multiline detail: {}", detail); 401 if assert_never!(detail.contains('\n'), "multiline detail: {}", detail) {
402 self.detail = Some(detail.splitn(2, '\n').next().unwrap().to_string());
403 }
402 } 404 }
403 self 405 self
404 } 406 }