diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-03 20:42:42 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-03 20:42:42 +0400 |
| commit | afaa9854fa6df74d7a1b85ebb1f45bdcd0dcc152 (patch) | |
| tree | 277216cd98ad12461fcb30eaf59c1b8d242e2d40 /compiler/rustc_middle/src/middle | |
| parent | e40d5e83dc133d093c22c7ff016b10daa4f40dcf (diff) | |
| download | rust-afaa9854fa6df74d7a1b85ebb1f45bdcd0dcc152.tar.gz rust-afaa9854fa6df74d7a1b85ebb1f45bdcd0dcc152.zip | |
Replace `&Vec<_>`s with `&[_]`s
Diffstat (limited to 'compiler/rustc_middle/src/middle')
| -rw-r--r-- | compiler/rustc_middle/src/middle/region.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs index 30ef6b775f5..c886175c6ea 100644 --- a/compiler/rustc_middle/src/middle/region.rs +++ b/compiler/rustc_middle/src/middle/region.rs @@ -16,6 +16,7 @@ use rustc_query_system::ich::StableHashingContext; use rustc_span::{Span, DUMMY_SP}; use std::fmt; +use std::ops::Deref; /// Represents a statically-describable scope that can be used to /// bound the lifetime/region for values. @@ -407,8 +408,8 @@ impl ScopeTree { /// Checks whether the given scope contains a `yield`. If so, /// returns `Some(YieldData)`. If not, returns `None`. - pub fn yield_in_scope(&self, scope: Scope) -> Option<&Vec<YieldData>> { - self.yield_in_scope.get(&scope) + pub fn yield_in_scope(&self, scope: Scope) -> Option<&[YieldData]> { + self.yield_in_scope.get(&scope).map(Deref::deref) } /// Gives the number of expressions visited in a body. |
