Skip to content

Commit 0e8033c

Browse files
committed
Do not merge: check if sometimes we can't get snippets
1 parent 7a01033 commit 0e8033c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_utils/src/source.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ fn snippet_with_applicability_sess<'a>(
514514
}
515515

516516
/// Converts a span to a code snippet. Returns `None` if not available.
517+
#[allow(clippy::unnecessary_wraps)]
517518
pub fn snippet_opt(sess: &impl HasSession, span: Span) -> Option<String> {
518-
sess.sess().source_map().span_to_snippet(span).ok()
519+
Some(sess.sess().source_map().span_to_snippet(span).unwrap())
519520
}
520521

521522
/// Converts a span (from a block) to a code snippet if available, otherwise use default.

0 commit comments

Comments
 (0)