Skip to content

Commit 5b9f8e7

Browse files
committed
Fix errors from rebase master
Note: 2nd Assist description is moved down: generated doc tests extracts now all tests (previously only the first one). But it uses the first `Assist` name -- which is the wrong one for the 2nd test. And 2nd assist is currently disabled -> would fail anyway.
1 parent b441aa2 commit 5b9f8e7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/ide_assists/src/handlers/destructure_tuple_binding.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ use crate::assist_context::{AssistBuilder, AssistContext, Assists};
2828
// let v = _0;
2929
// }
3030
// ```
31-
//
32-
//
33-
// And (currently disabled):
31+
pub(crate) fn destructure_tuple_binding(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
32+
destructure_tuple_binding_impl(acc, ctx, false)
33+
}
34+
35+
// And when `with_sub_pattern` enabled (currently disabled):
3436
// Assist: destructure_tuple_binding_in_sub_pattern
3537
//
3638
// Destructures tuple items in sub-pattern (after `@`).
@@ -48,10 +50,6 @@ use crate::assist_context::{AssistBuilder, AssistContext, Assists};
4850
// let v = _0;
4951
// }
5052
// ```
51-
pub(crate) fn destructure_tuple_binding(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
52-
destructure_tuple_binding_impl(acc, ctx, false)
53-
}
54-
5553
pub(crate) fn destructure_tuple_binding_impl(
5654
acc: &mut Assists,
5755
ctx: &AssistContext,
@@ -96,7 +94,7 @@ fn collect_data(ident_pat: IdentPat, ctx: &AssistContext) -> Option<TupleData> {
9694

9795
let ty = ctx.sema.type_of_pat(&ident_pat.clone().into())?;
9896
// might be reference
99-
let ty = ty.strip_references();
97+
let ty = ty.adjusted().strip_references();
10098
// must be tuple
10199
let field_types = ty.tuple_fields(ctx.db());
102100
if field_types.is_empty() {

0 commit comments

Comments
 (0)