From 6ac9c4ad6ae2ce246a8c70d468ae2dabb484a03d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 7 Feb 2020 15:04:50 +0100 Subject: Cleanup --- crates/ra_assists/src/assist_ctx.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists/src/assist_ctx.rs') 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> { should_compute_edit: bool, } -impl<'a> Clone for AssistCtx<'a> { +impl Clone for AssistCtx<'_> { fn clone(&self) -> Self { AssistCtx { db: self.db, @@ -80,8 +80,7 @@ impl<'a> AssistCtx<'a> { label: impl Into, f: impl FnOnce(&mut ActionBuilder), ) -> Option { - let label = AssistLabel { label: label.into(), id }; - assert!(label.label.chars().nth(0).unwrap().is_uppercase()); + let label = AssistLabel::new(label.into(), id); let assist = if self.should_compute_edit { let action = { @@ -103,7 +102,7 @@ impl<'a> AssistCtx<'a> { label: impl Into, f: impl FnOnce() -> Vec, ) -> Option { - let label = AssistLabel { label: label.into(), id }; + let label = AssistLabel::new(label.into(), id); let assist = if self.should_compute_edit { let actions = f(); assert!(!actions.is_empty(), "Assist cannot have no"); -- cgit v1.2.3