Skip to content

Commit 144ba0f

Browse files
committed
make helper functions generic over Context kind
will make it easier to switch to `EarlyContext` later
1 parent 5fde205 commit 144ba0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/semicolon_block.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl SemicolonBlock {
7878
}
7979
}
8080

81-
fn semicolon_inside_block(&self, cx: &LateContext<'_>, block: &Block<'_>, tail: &Expr<'_>, semi_span: Span) {
81+
fn semicolon_inside_block(&self, cx: &impl LintContext, block: &Block<'_>, tail: &Expr<'_>, semi_span: Span) {
8282
let insert_span = tail.span.source_callsite().shrink_to_hi();
8383
let remove_span = semi_span.with_lo(block.span.hi());
8484

@@ -101,7 +101,7 @@ impl SemicolonBlock {
101101
);
102102
}
103103

104-
fn semicolon_outside_block(&self, cx: &LateContext<'_>, block: &Block<'_>, tail_stmt_expr: &Expr<'_>) {
104+
fn semicolon_outside_block(&self, cx: &impl LintContext, block: &Block<'_>, tail_stmt_expr: &Expr<'_>) {
105105
let insert_span = block.span.shrink_to_hi();
106106

107107
// For macro call semicolon statements (`mac!();`), the statement's span does not actually
@@ -164,6 +164,6 @@ impl LateLintPass<'_> for SemicolonBlock {
164164
}
165165
}
166166

167-
fn get_line(cx: &LateContext<'_>, span: Span) -> Option<usize> {
167+
fn get_line(cx: &impl LintContext, span: Span) -> Option<usize> {
168168
cx.sess().source_map().lookup_line(span.lo()).ok().map(|line| line.line)
169169
}

0 commit comments

Comments
 (0)