Skip to content

Commit a500545

Browse files
committed
no unwrap
1 parent 9e1dbdc commit a500545

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/use_crate_prefix_for_self_imports.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
2-
use clippy_utils::source::snippet_opt;
32
use def_id::LOCAL_CRATE;
43
use rustc_data_structures::fx::FxHashSet;
54
use rustc_errors::Applicability;
@@ -157,7 +156,7 @@ impl<'tcx> UseCratePrefixForSelfImports<'_, 'tcx> {
157156
segment.ident.span,
158157
"this import is not clear",
159158
"prefix with `crate::`",
160-
format!("crate::{}", snippet_opt(cx, segment.ident.span).unwrap()),
159+
format!("crate::{root}"),
161160
Applicability::MachineApplicable,
162161
);
163162
}

0 commit comments

Comments
 (0)