Comply with clippy

This commit is contained in:
Chadtech 2021-04-05 19:39:01 -04:00
parent 6686c5b051
commit 132d63764c
2 changed files with 11 additions and 11 deletions

View file

@ -139,7 +139,7 @@ fn generate_module_doc<'a>(
Alias { name, vars, ann } => { Alias { name, vars, ann } => {
let mut type_vars = Vec::new(); let mut type_vars = Vec::new();
for var in vars.into_iter() { for var in vars.iter() {
if let Pattern::Identifier(ident_name) = var.value { if let Pattern::Identifier(ident_name) = var.value {
type_vars.push(ident_name.to_string()); type_vars.push(ident_name.to_string());
} }
@ -162,7 +162,7 @@ fn generate_module_doc<'a>(
} }
} }
fn type_to_docs<'a>(type_annotation: TypeAnnotation) -> Option<DocTypeAnnotation> { fn type_to_docs(type_annotation: TypeAnnotation) -> Option<DocTypeAnnotation> {
match type_annotation { match type_annotation {
TypeAnnotation::TagUnion { TypeAnnotation::TagUnion {
tags, tags,
@ -187,7 +187,7 @@ fn type_to_docs<'a>(type_annotation: TypeAnnotation) -> Option<DocTypeAnnotation
} }
} }
index = index + 1; index += 1;
} }
if any_tags_are_private { if any_tags_are_private {
@ -210,7 +210,7 @@ fn type_to_docs<'a>(type_annotation: TypeAnnotation) -> Option<DocTypeAnnotation
if !module_name.is_empty() { if !module_name.is_empty() {
name.push_str(module_name); name.push_str(module_name);
name.push_str("."); name.push('.');
} }
name.push_str(type_name); name.push_str(type_name);
@ -251,7 +251,7 @@ fn tag_to_doc(tag: Tag) -> Option<DocTag> {
type_vars.push(type_var); type_vars.push(type_var);
} }
index = index + 1; index += 1;
} }
type_vars type_vars

View file

@ -201,7 +201,7 @@ fn type_annotation_to_html(indent_level: usize, buf: &mut String, type_ann: &Doc
let tag_union_indent = indent_level + 1; let tag_union_indent = indent_level + 1;
indent(buf, tag_union_indent); indent(buf, tag_union_indent);
buf.push_str("["); buf.push('[');
buf.push_str("<br>"); buf.push_str("<br>");
let mut index = 0; let mut index = 0;
@ -217,23 +217,23 @@ fn type_annotation_to_html(indent_level: usize, buf: &mut String, type_ann: &Doc
while tag_value_index < tag.values.len() { while tag_value_index < tag.values.len() {
let type_value = &tag.values[tag_value_index]; let type_value = &tag.values[tag_value_index];
buf.push_str(" "); buf.push(' ');
type_annotation_to_html(next_indent_level, buf, type_value); type_annotation_to_html(next_indent_level, buf, type_value);
tag_value_index = tag_value_index + 1; tag_value_index += 1;
} }
if index < (tags_len - 1) { if index < (tags_len - 1) {
buf.push_str(","); buf.push(',');
} }
buf.push_str("<br>"); buf.push_str("<br>");
index = index + 1; index += 1;
} }
indent(buf, tag_union_indent); indent(buf, tag_union_indent);
buf.push_str("]"); buf.push(']');
if let Some(ext) = extension { if let Some(ext) = extension {
type_annotation_to_html(indent_level, buf, ext); type_annotation_to_html(indent_level, buf, ext);