diff options
| author | bors <bors@rust-lang.org> | 2022-11-24 00:17:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-24 00:17:35 +0000 |
| commit | 872631d0f0fadffe3220ab1bd9c8f1f2342341e2 (patch) | |
| tree | 6721d534b4d7f5b0e7c364c451ffb6b792bfdea7 /compiler/rustc_parse/src/parser | |
| parent | 70f8737b2f5d3bf7d6b784fad00b663b7ff9feda (diff) | |
| parent | 94470f4efd2ec0786dd1f201e9ea84651b4bb0d0 (diff) | |
| download | rust-872631d0f0fadffe3220ab1bd9c8f1f2342341e2.tar.gz rust-872631d0f0fadffe3220ab1bd9c8f1f2342341e2.zip | |
Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 2 |
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 94c83503dc9..3f5baf343c9 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2565,7 +2565,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, |
