Skip to content

Commit 77f44f2

Browse files
committed
default_constructed_unit_structs: use check_source_text
1 parent 1c14af8 commit 77f44f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/default_constructed_unit_structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl LateLintPass<'_> for DefaultConstructedUnitStructs {
7575
&& !base.is_suggestable_infer_ty()
7676
{
7777
let mut removals = vec![(expr.span.with_lo(qpath.qself_span().hi()), String::new())];
78-
if expr.span.with_source_text(cx, |s| s.starts_with('<')) == Some(true) {
78+
if expr.span.check_source_text(cx, |s| s.starts_with('<')) {
7979
// Remove `<`, '>` has already been removed by the existing removal expression.
8080
removals.push((expr.span.with_hi(qpath.qself_span().lo()), String::new()));
8181
}

0 commit comments

Comments
 (0)