Skip to content

Commit b78509e

Browse files
committed
Add testcase for next_point, fix more trivial issues in find_width_of_character_at_span
1 parent 4f50e6f commit b78509e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_utils/src/sugg.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,7 @@ impl<T: LintContext> DiagnosticExt<T> for rustc_errors::Diagnostic {
769769

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

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

0 commit comments

Comments
 (0)