]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/middle/region.rs
Replace `&Vec<_>`s with `&[_]`s
[rust.git] / compiler / rustc_middle / src / middle / region.rs
index 30ef6b775f5e3c131c704fa337c5e8d8f07b7034..c886175c6ea0e2ddf25aad35f42de2fcbe97333a 100644 (file)
@@ -16,6 +16,7 @@
 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 @@ pub fn is_subscope_of(&self, subscope: Scope, superscope: Scope) -> bool {
 
     /// 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.