From f18a2d7c5aceab89d8df21e1e0922cb48b9a07f0 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:01:41 +0000 Subject: [PATCH] refactor: do not use pointless assertion --- helix-core/src/comment.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs index d0771e05b..d3d93fcde 100644 --- a/helix-core/src/comment.rs +++ b/helix-core/src/comment.rs @@ -491,42 +491,39 @@ mod test { #[test] fn uncomment() { let mut doc = Rope::from(" # 1\n\n # 2\n # 3"); - let mut range = Range::new(0, doc.len_chars() - 1); + let range = Range::new(0, doc.len_chars() - 1); let changes = toggle_line_comments(&doc, &range, None); let transaction = Transaction::change(&doc, changes.into_iter()); transaction.apply(&mut doc); - range = range.map(transaction.changes()); + _ = range.map(transaction.changes()); assert_eq!(doc, " 1\n\n 2\n 3"); - assert_eq!(range, range); // to ignore the selection unused warning } #[test] fn uncomment_0_margin_comments() { let mut doc = Rope::from(" #1\n\n #2\n #3"); - let mut range = Range::new(0, doc.len_chars() - 1); + let range = Range::new(0, doc.len_chars() - 1); let changes = toggle_line_comments(&doc, &range, None); let transaction = Transaction::change(&doc, changes.into_iter()); transaction.apply(&mut doc); - range = range.map(transaction.changes()); + _ = range.map(transaction.changes()); assert_eq!(doc, " 1\n\n 2\n 3"); - assert_eq!(range, range); // to ignore the selection unused warning } #[test] fn uncomment_0_margin_comments_with_no_space() { let mut doc = Rope::from("#"); - let mut range = Range::new(0, doc.len_chars() - 1); + let range = Range::new(0, doc.len_chars() - 1); let changes = toggle_line_comments(&doc, &range, None); let transaction = Transaction::change(&doc, changes.into_iter()); transaction.apply(&mut doc); - range = range.map(transaction.changes()); + _ = range.map(transaction.changes()); assert_eq!(doc, ""); - assert_eq!(range, range); // to ignore the selection unused warning } #[test]