aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/type_ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/type_ref.rs')
-rw-r--r--crates/ra_hir/src/type_ref.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/type_ref.rs b/crates/ra_hir/src/type_ref.rs
index fa91bfb22..bc8acc7ee 100644
--- a/crates/ra_hir/src/type_ref.rs
+++ b/crates/ra_hir/src/type_ref.rs
@@ -150,4 +150,11 @@ impl TypeBound {
150 ast::TypeBoundKind::ForType(_) | ast::TypeBoundKind::Lifetime(_) => TypeBound::Error, 150 ast::TypeBoundKind::ForType(_) | ast::TypeBoundKind::Lifetime(_) => TypeBound::Error,
151 } 151 }
152 } 152 }
153
154 pub fn as_path(&self) -> Option<&Path> {
155 match self {
156 TypeBound::Path(p) => Some(p),
157 _ => None,
158 }
159 }
153} 160}