]> git.lizzy.rs Git - rust.git/commitdiff
fix: replace doc-comments with normal comments
authorLuiz Carlos <luizcarlosmpc@gmail.com>
Fri, 12 Mar 2021 11:44:03 +0000 (08:44 -0300)
committerGitHub <noreply@github.com>
Fri, 12 Mar 2021 11:44:03 +0000 (08:44 -0300)
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs

index 7e6cae9e1e1463d4688301278e3692a91612d01a..661a3fbeb868622317387d46ebf6a010d2f5ca62 100644 (file)
@@ -6,27 +6,27 @@
 
 use crate::{AssistContext, AssistId, AssistKind, Assists};
 
-/// Assist: convert_iter_for_each_to_for
+// Assist: convert_iter_for_each_to_for
 //
-/// Converts an Iterator::for_each function into a for loop.
-///
-/// ```rust
-/// fn main() {
-///     let vec = vec![(1, 2), (2, 3), (3, 4)];
-///     x.iter().for_each(|(x, y)| {
-///         println!("x: {}, y: {}", x, y);
-///    })
-/// }
-/// ```
-/// ->
-/// ```rust
-/// fn main() {
-///     let vec = vec![(1, 2), (2, 3), (3, 4)];
-///     for (x, y) in x.iter() {
-///         println!("x: {}, y: {}", x, y);
-///     });
-/// }
-/// ```
+// Converts an Iterator::for_each function into a for loop.
+//
+// ```rust
+// fn main() {
+//     let vec = vec![(1, 2), (2, 3), (3, 4)];
+//     x.iter().for_each(|(x, y)| {
+//         println!("x: {}, y: {}", x, y);
+//     });
+// }
+// ```
+// ->
+// ```rust
+// fn main() {
+//     let vec = vec![(1, 2), (2, 3), (3, 4)];
+//     for (x, y) in x.iter() {
+//         println!("x: {}, y: {}", x, y);
+//     }
+// }
+// ```
 pub(crate) fn convert_iter_for_each_to_for(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
     let method = ctx.find_node_at_offset::<ast::MethodCallExpr>()?;
     let stmt = method.syntax().parent().and_then(ast::ExprStmt::cast);