Skip to content

Commit

Permalink
Add testcase for next_point, fix more trivial issues in find_width_of…
Browse files Browse the repository at this point in the history
…_character_at_span
  • Loading branch information
chenyukang committed Oct 19, 2022
1 parent 4f50e6f commit b78509e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,7 @@ impl<T: LintContext> DiagnosticExt<T> for rustc_errors::Diagnostic {

fn suggest_remove_item(&mut self, cx: &T, item: Span, msg: &str, applicability: Applicability) {
let mut remove_span = item;
let hi = cx.sess().source_map().next_point(remove_span).hi();
let fmpos = cx.sess().source_map().lookup_byte_offset(hi);
let fmpos = cx.sess().source_map().lookup_byte_offset(remove_span.hi());

if let Some(ref src) = fmpos.sf.src {
let non_whitespace_offset = src[fmpos.pos.to_usize()..].find(|c| c != ' ' && c != '\t' && c != '\n');
Expand Down

0 comments on commit b78509e

Please sign in to comment.