We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a01033 commit 0e8033cCopy full SHA for 0e8033c
clippy_utils/src/source.rs
@@ -514,8 +514,9 @@ fn snippet_with_applicability_sess<'a>(
514
}
515
516
/// Converts a span to a code snippet. Returns `None` if not available.
517
+#[allow(clippy::unnecessary_wraps)]
518
pub fn snippet_opt(sess: &impl HasSession, span: Span) -> Option<String> {
- sess.sess().source_map().span_to_snippet(span).ok()
519
+ Some(sess.sess().source_map().span_to_snippet(span).unwrap())
520
521
522
/// Converts a span (from a block) to a code snippet if available, otherwise use default.
0 commit comments