Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/extract_function.rs')
| -rw-r--r-- | crates/ide-assists/src/handlers/extract_function.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ide-assists/src/handlers/extract_function.rs b/crates/ide-assists/src/handlers/extract_function.rs index 967da41c15..330587e0db 100644 --- a/crates/ide-assists/src/handlers/extract_function.rs +++ b/crates/ide-assists/src/handlers/extract_function.rs @@ -272,7 +272,7 @@ fn make_function_name(semantics_scope: &hir::SemanticsScope<'_>) -> ast::NameRef /// * We want whole node, like `loop {}`, `2 + 2`, `{ let n = 1; }` exprs. /// Then we can use `ast::Expr` /// * We want a few statements for a block. E.g. -/// ```rust,no_run +/// ```ignore /// fn foo() -> i32 { /// let m = 1; /// $0 @@ -386,7 +386,7 @@ struct ContainerInfo { /// Control flow that is exported from extracted function /// /// E.g.: -/// ```rust,no_run +/// ```ignore /// loop { /// $0 /// if 42 == 42 { @@ -750,7 +750,10 @@ impl FunctionBody { ast::Stmt::Item(_) => (), ast::Stmt::LetStmt(stmt) => { if let Some(pat) = stmt.pat() { - walk_pat(&pat, cb); + walk_pat(&pat, &mut |pat| { + cb(pat); + std::ops::ControlFlow::<(), ()>::Continue(()) + }); } if let Some(expr) = stmt.initializer() { walk_patterns_in_expr(&expr, cb); |