aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLuiz Carlos <[email protected]>2021-03-12 11:44:03 +0000
committerGitHub <[email protected]>2021-03-12 11:44:03 +0000
commit7a9230acdfe900d9e42f0b8cd37e4a7db6d8ff18 (patch)
tree15b2f2e8710d140d809df58ca54abfb1760655ad /crates
parentf67861310c1bdcb39301aa6c54d49aa719119a8b (diff)
fix: replace doc-comments with normal comments
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs40
1 files changed, 20 insertions, 20 deletions
diff --git a/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs b/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
index 7e6cae9e1..661a3fbeb 100644
--- a/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
+++ b/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
@@ -6,27 +6,27 @@ use syntax::{
6 6
7use crate::{AssistContext, AssistId, AssistKind, Assists}; 7use crate::{AssistContext, AssistId, AssistKind, Assists};
8 8
9/// Assist: convert_iter_for_each_to_for 9// Assist: convert_iter_for_each_to_for
10// 10//
11/// Converts an Iterator::for_each function into a for loop. 11// Converts an Iterator::for_each function into a for loop.
12/// 12//
13/// ```rust 13// ```rust
14/// fn main() { 14// fn main() {
15/// let vec = vec![(1, 2), (2, 3), (3, 4)]; 15// let vec = vec![(1, 2), (2, 3), (3, 4)];
16/// x.iter().for_each(|(x, y)| { 16// x.iter().for_each(|(x, y)| {
17/// println!("x: {}, y: {}", x, y); 17// println!("x: {}, y: {}", x, y);
18/// }) 18// });
19/// } 19// }
20/// ``` 20// ```
21/// -> 21// ->
22/// ```rust 22// ```rust
23/// fn main() { 23// fn main() {
24/// let vec = vec![(1, 2), (2, 3), (3, 4)]; 24// let vec = vec![(1, 2), (2, 3), (3, 4)];
25/// for (x, y) in x.iter() { 25// for (x, y) in x.iter() {
26/// println!("x: {}, y: {}", x, y); 26// println!("x: {}, y: {}", x, y);
27/// }); 27// }
28/// } 28// }
29/// ``` 29// ```
30pub(crate) fn convert_iter_for_each_to_for(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { 30pub(crate) fn convert_iter_for_each_to_for(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
31 let method = ctx.find_node_at_offset::<ast::MethodCallExpr>()?; 31 let method = ctx.find_node_at_offset::<ast::MethodCallExpr>()?;
32 let stmt = method.syntax().parent().and_then(ast::ExprStmt::cast); 32 let stmt = method.syntax().parent().and_then(ast::ExprStmt::cast);