aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_ctx.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-06 10:10:16 +0000
committerGitHub <[email protected]>2020-03-06 10:10:16 +0000
commitd75577fcee79aac06bdddb01fde431f26432c36c (patch)
tree693a4d4c970cbc88feed6dbadd0656a04449242e /crates/ra_assists/src/assist_ctx.rs
parent670895a49c271751bf275f0ca1303a1bca7aad5a (diff)
parent0ff8c55246d242af2f2fc4f88e67395320d00865 (diff)
Merge #3483
3483: Unfold groups with single assists into plain assists r=matklad a=SomeoneToIgnore A follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/3120/files#r378788698 , made to show more detailed label when the assist group contains a single element Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r--crates/ra_assists/src/assist_ctx.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs
index c25d2e323..62182cf03 100644
--- a/crates/ra_assists/src/assist_ctx.rs
+++ b/crates/ra_assists/src/assist_ctx.rs
@@ -166,8 +166,11 @@ impl<'a> AssistGroup<'a> {
166 } 166 }
167 167
168 pub(crate) fn finish(self) -> Option<Assist> { 168 pub(crate) fn finish(self) -> Option<Assist> {
169 assert!(!self.assists.is_empty()); 169 if self.assists.is_empty() {
170 Some(Assist(self.assists)) 170 None
171 } else {
172 Some(Assist(self.assists))
173 }
171 } 174 }
172} 175}
173 176