diff options
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r-- | crates/ra_assists/src/assist_ctx.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index b2381bd97..44d6f6808 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -57,7 +57,7 @@ pub(crate) struct AssistCtx<'a> { | |||
57 | should_compute_edit: bool, | 57 | should_compute_edit: bool, |
58 | } | 58 | } |
59 | 59 | ||
60 | impl<'a> Clone for AssistCtx<'a> { | 60 | impl Clone for AssistCtx<'_> { |
61 | fn clone(&self) -> Self { | 61 | fn clone(&self) -> Self { |
62 | AssistCtx { | 62 | AssistCtx { |
63 | db: self.db, | 63 | db: self.db, |
@@ -80,8 +80,7 @@ impl<'a> AssistCtx<'a> { | |||
80 | label: impl Into<String>, | 80 | label: impl Into<String>, |
81 | f: impl FnOnce(&mut ActionBuilder), | 81 | f: impl FnOnce(&mut ActionBuilder), |
82 | ) -> Option<Assist> { | 82 | ) -> Option<Assist> { |
83 | let label = AssistLabel { label: label.into(), id }; | 83 | let label = AssistLabel::new(label.into(), id); |
84 | assert!(label.label.chars().nth(0).unwrap().is_uppercase()); | ||
85 | 84 | ||
86 | let assist = if self.should_compute_edit { | 85 | let assist = if self.should_compute_edit { |
87 | let action = { | 86 | let action = { |
@@ -103,7 +102,7 @@ impl<'a> AssistCtx<'a> { | |||
103 | label: impl Into<String>, | 102 | label: impl Into<String>, |
104 | f: impl FnOnce() -> Vec<ActionBuilder>, | 103 | f: impl FnOnce() -> Vec<ActionBuilder>, |
105 | ) -> Option<Assist> { | 104 | ) -> Option<Assist> { |
106 | let label = AssistLabel { label: label.into(), id }; | 105 | let label = AssistLabel::new(label.into(), id); |
107 | let assist = if self.should_compute_edit { | 106 | let assist = if self.should_compute_edit { |
108 | let actions = f(); | 107 | let actions = f(); |
109 | assert!(!actions.is_empty(), "Assist cannot have no"); | 108 | assert!(!actions.is_empty(), "Assist cannot have no"); |