Skip to content

Commit 0038915

Browse files
committed
wip
1 parent a943356 commit 0038915

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clippy_lints/src/use_crate_prefix_for_self_imports.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ impl<'tcx> UseCratePrefixForSelfImports<'_, 'tcx> {
106106
}
107107
let gap_span = latest_span.between(span);
108108
let gap_snippet = gap_span.get_source_text(cx).unwrap();
109+
println!("{:?}", tokenize_with_text(&gap_snippet).collect::<Vec<_>>());
109110
for (token, source, inner_span) in tokenize_with_text(&gap_snippet) {
110111
match token {
111-
rustc_lexer::TokenKind::Whitespace => return false,
112+
rustc_lexer::TokenKind::Whitespace => {
113+
if source.chars().filter(|c| *c == '\n').count() > 1 {
114+
return false;
115+
}
116+
},
112117
_ => {},
113118
}
114119
}

0 commit comments

Comments
 (0)