about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-11-16 21:58:58 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-11-16 21:58:58 +0000
commit94470f4efd2ec0786dd1f201e9ea84651b4bb0d0 (patch)
tree1bcf415fa3d0bedc9b223162446ab9653c8f5bec /compiler/rustc_parse/src
parente702534763599db252f2ca308739ec340d0933de (diff)
downloadrust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.tar.gz
rust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.zip
Use `as_deref` in compiler (but only where it makes sense)
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 0bbe073fe2a..4b059d4443c 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -2562,7 +2562,7 @@ impl<'a> Parser<'a> {
             if let [a, b] = segments {
                 let (a_span, b_span) = (a.span(), b.span());
                 let between_span = a_span.shrink_to_hi().to(b_span.shrink_to_lo());
-                if self.span_to_snippet(between_span).as_ref().map(|a| &a[..]) == Ok(":: ") {
+                if self.span_to_snippet(between_span).as_deref() == Ok(":: ") {
                     return Err(DoubleColonInBound {
                         span: path.span.shrink_to_hi(),
                         between: between_span,