Merge branch 'trunk' into Str.fromUtf8Range

This commit is contained in:
joshuaharry 2021-08-10 15:31:09 -05:00 committed by GitHub
commit d3d7ca03b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -165,13 +165,14 @@ fn generate_entry_doc<'a>(
(new_acc, Some(comments_or_new_lines)) (new_acc, Some(comments_or_new_lines))
} }
Def::Annotation(loc_pattern, _loc_ann) => match loc_pattern.value { Def::Annotation(loc_pattern, loc_ann) => match loc_pattern.value {
Pattern::Identifier(identifier) => { Pattern::Identifier(identifier) => {
// Check if the definition is exposed // Check if the definition is exposed
if ident_ids.get_id(&identifier.into()).is_some() { if ident_ids.get_id(&identifier.into()).is_some() {
let name = identifier.to_string();
let doc_def = DocDef { let doc_def = DocDef {
name: identifier.to_string(), name,
type_annotation: NoTypeAnn, type_annotation: type_to_docs(false, loc_ann.value),
type_vars: Vec::new(), type_vars: Vec::new(),
docs: before_comments_or_new_lines.and_then(comments_or_new_lines_to_docs), docs: before_comments_or_new_lines.and_then(comments_or_new_lines_to_docs),
}; };

View file

@ -624,7 +624,7 @@ fn should_be_multiline(type_ann: &TypeAnnotation) -> bool {
is_multiline is_multiline
} }
TypeAnnotation::Function { args, output } => { TypeAnnotation::Function { args, output } => {
let mut is_multiline = should_be_multiline(output) || args.len() > 1; let mut is_multiline = should_be_multiline(output) || args.len() > 2;
for arg in args { for arg in args {
if is_multiline { if is_multiline {