diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-14 14:50:21 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-14 15:05:49 -0800 |
commit | 6fbc343032307ff6d5b1705dc6cb0284601873e3 (patch) | |
tree | 36cd77e76d8895e1461ee861f6b7e5e6eb3bcbf0 | |
parent | f1caa107f463a548524572bd426fd7fe4e7d13f5 (diff) |
Add the `Item::is_named` helper method
-rw-r--r-- | src/ir/item.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir/item.rs b/src/ir/item.rs index 4c65c433..5b785513 100644 --- a/src/ir/item.rs +++ b/src/ir/item.rs @@ -472,6 +472,13 @@ impl Item { self.kind().as_type() } + /// Is this item a named template type parameter? + pub fn is_named(&self) -> bool { + self.as_type() + .map(|ty| ty.is_named()) + .unwrap_or(false) + } + /// Get a reference to this item's underlying `Function`. Panic if this is /// some other kind of item. pub fn expect_function(&self) -> &Function { |