diff options
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index b71df7e5d..d476088a2 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -34,6 +34,14 @@ pub struct AssistLabel { | |||
34 | pub id: AssistId, | 34 | pub id: AssistId, |
35 | } | 35 | } |
36 | 36 | ||
37 | impl AssistLabel { | ||
38 | pub(crate) fn new(label: String, id: AssistId) -> AssistLabel { | ||
39 | // FIXME: make fields private, so that this invariant can't be broken | ||
40 | assert!(label.chars().nth(0).unwrap().is_uppercase()); | ||
41 | AssistLabel { label: label.into(), id } | ||
42 | } | ||
43 | } | ||
44 | |||
37 | #[derive(Debug, Clone)] | 45 | #[derive(Debug, Clone)] |
38 | pub struct AssistAction { | 46 | pub struct AssistAction { |
39 | pub label: Option<String>, | 47 | pub label: Option<String>, |