Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/generate_documentation_template.rs')
| -rw-r--r-- | crates/ide_assists/src/handlers/generate_documentation_template.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ide_assists/src/handlers/generate_documentation_template.rs b/crates/ide_assists/src/handlers/generate_documentation_template.rs index cfc7e9d043..1481eadb51 100644 --- a/crates/ide_assists/src/handlers/generate_documentation_template.rs +++ b/crates/ide_assists/src/handlers/generate_documentation_template.rs @@ -59,9 +59,8 @@ pub(crate) fn generate_documentation_template( "Generate a documentation template", text_range, |builder| { - let mut doc_lines = Vec::new(); // Introduction / short function description before the sections - doc_lines.push(introduction_builder(&ast_func, ctx)); + let mut doc_lines = vec![introduction_builder(&ast_func, ctx)]; // Then come the sections if let Some(mut lines) = examples_builder(&ast_func, ctx) { doc_lines.push("".into()); @@ -303,7 +302,7 @@ fn arguments_from_params(param_list: &ast::ParamList) -> String { // instance `TuplePat`) could be managed later. Some(ast::Pat::IdentPat(ident_pat)) => match ident_pat.name() { Some(name) => match is_a_ref_mut_param(¶m) { - true => format!("&mut {}", name.to_string()), + true => format!("&mut {}", name), false => name.to_string(), }, None => "_".to_string(), |