From d5c9de65c555235d7a27dc4617858b7a24be4935 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 22 Apr 2021 00:54:31 +0200 Subject: Don't filter equal nodes in reorder assists --- crates/ide_assists/src/handlers/reorder_fields.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ide_assists/src/handlers/reorder_fields.rs') diff --git a/crates/ide_assists/src/handlers/reorder_fields.rs b/crates/ide_assists/src/handlers/reorder_fields.rs index 1a95135ca..e90bbdbcf 100644 --- a/crates/ide_assists/src/handlers/reorder_fields.rs +++ b/crates/ide_assists/src/handlers/reorder_fields.rs @@ -83,11 +83,9 @@ fn replace( fields: impl Iterator, sorted_fields: impl IntoIterator, ) { - fields.zip(sorted_fields).filter(|(field, sorted)| field != sorted).for_each( - |(field, sorted_field)| { - ted::replace(field.syntax(), sorted_field.syntax().clone_for_update()); - }, - ); + fields.zip(sorted_fields).for_each(|(field, sorted_field)| { + ted::replace(field.syntax(), sorted_field.syntax().clone_for_update()) + }); } fn compute_fields_ranks(path: &ast::Path, ctx: &AssistContext) -> Option> { -- cgit v1.2.3