diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-18 12:58:54 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-18 12:58:54 +0000 |
commit | 1b5405620fa4df57d865a5dd7df6fca8664d93d5 (patch) | |
tree | 23751dbe7ce7a9039cc30768ef521897b5e4ff9a | |
parent | 1f53026997536d5f08cc0d7165aae6222b74b8c0 (diff) | |
parent | a60168e674e04d308a92ff77a6430dbe2ac3a6a1 (diff) |
Merge #7322
7322: Use assert_never properly r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r-- | crates/completion/src/item.rs | 4 |
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 | } |