From 506293ca43f4cae7520c9e14b6b36b42b1af4ce1 Mon Sep 17 00:00:00 2001 From: Matt Hall Date: Sun, 21 Feb 2021 17:36:37 +0000 Subject: Add convert_for_to_iter_for_each assist --- crates/ide_assists/src/tests/generated.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/ide_assists/src/tests/generated.rs') diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index 0516deaff..100c3b7fe 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs @@ -192,6 +192,29 @@ pub(crate) fn frobnicate() {} ) } +#[test] +fn doctest_convert_for_to_iter_for_each() { + check_doc_test( + "convert_for_to_iter_for_each", + r#####" +fn main() { + let x = vec![1, 2, 3]; + for $0v in x { + let y = v * 2; + } +} +"#####, + r#####" +fn main() { + let x = vec![1, 2, 3]; + x.into_iter().for_each(|v| { + let y = v * 2; + }); +} +"#####, + ) +} + #[test] fn doctest_convert_integer_literal() { check_doc_test( -- cgit v1.2.3