Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/extract_variable.rs')
| -rw-r--r-- | crates/ide-assists/src/handlers/extract_variable.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide-assists/src/handlers/extract_variable.rs b/crates/ide-assists/src/handlers/extract_variable.rs index c5c57c76b4..d4a0490f16 100644 --- a/crates/ide-assists/src/handlers/extract_variable.rs +++ b/crates/ide-assists/src/handlers/extract_variable.rs @@ -65,7 +65,7 @@ use crate::{AssistContext, AssistId, Assists, utils::is_body_const}; // VAR_NAME * 4; // } // ``` -pub(crate) fn extract_variable(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { +pub(crate) fn extract_variable(acc: &mut Assists, ctx: &AssistContext<'_, '_>) -> Option<()> { let node = if ctx.has_empty_selection() { if let Some(t) = ctx.token_at_offset().find(|it| it.kind() == T![;]) { t.parent().and_then(ast::ExprStmt::cast)?.syntax().clone() @@ -332,7 +332,7 @@ fn peel_parens(mut expr: ast::Expr) -> ast::Expr { /// Check whether the node is a valid expression which can be extracted to a variable. /// In general that's true for any expression, but in some cases that would produce invalid code. -fn valid_target_expr(ctx: &AssistContext<'_>) -> impl Fn(SyntaxNode) -> Option<ast::Expr> { +fn valid_target_expr(ctx: &AssistContext<'_, '_>) -> impl Fn(SyntaxNode) -> Option<ast::Expr> { let selection = ctx.selection_trimmed(); move |node| match node.kind() { SyntaxKind::LOOP_EXPR | SyntaxKind::LET_EXPR => None, @@ -383,7 +383,7 @@ impl ExtractionKind { fn get_name_and_expr( &self, - ctx: &AssistContext<'_>, + ctx: &AssistContext<'_, '_>, to_extract: &ast::Expr, ) -> (String, SyntaxNode) { // We only do this sort of extraction for fields because they should have lowercase names @@ -416,7 +416,7 @@ impl ExtractionKind { } } -fn get_literal_name(ctx: &AssistContext<'_>, expr: &ast::Expr) -> Option<String> { +fn get_literal_name(ctx: &AssistContext<'_, '_>, expr: &ast::Expr) -> Option<String> { let ast::Expr::Literal(literal) = expr else { return None; }; @@ -512,7 +512,7 @@ impl Anchor { } } -fn like_const_value(ctx: &AssistContext<'_>, path_resolution: hir::PathResolution) -> bool { +fn like_const_value(ctx: &AssistContext<'_, '_>, path_resolution: hir::PathResolution) -> bool { let db = ctx.db(); let adt_like_const_value = |adt: Option<hir::Adt>| matches!(adt, Some(hir::Adt::Struct(s)) if s.kind(db) == hir::StructKind::Unit); match path_resolution { |