From 6fbc343032307ff6d5b1705dc6cb0284601873e3 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 14 Feb 2017 14:50:21 -0800 Subject: Add the `Item::is_named` helper method --- src/ir/item.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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 { -- cgit v1.2.3