Skip to content

Commit e74cfe4

Browse files
GearsDatapackslpil
authored andcommitted
Come on clippy
1 parent 16f9fed commit e74cfe4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler-core/src/analyse.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,15 +1983,15 @@ fn get_compatible_record_fields(constructors: &[TypeValueConstructor]) -> Vec<Re
19831983
// If there is only one constructor, we simply show the documentation
19841984
// for the field.
19851985
first_parameter.documentation.clone()
1986-
} else if let Some(field_documentation) = &first_parameter.documentation {
1986+
} else {
19871987
// If there are multiple constructors, we show the documentation of
19881988
// this field for each of the variants.
1989-
Some(eco_format!("## {}\n\n{}", first.name, field_documentation))
1990-
} else {
1991-
// If there is no documentation on the field of the first constructor,
1992-
// we leave it as `None` until we find a field which does have
1993-
// documentation.
1994-
None
1989+
first_parameter
1990+
.documentation
1991+
.as_ref()
1992+
.map(|field_documentation| {
1993+
eco_format!("## {}\n\n{}", first.name, field_documentation)
1994+
})
19951995
};
19961996

19971997
// Check each variant to see if they have an field in the same position

0 commit comments

Comments
 (0)