Add a header
method to FnKind
This commit is contained in:
parent
4530c528ba
commit
c0ad4b0a96
1 changed files with 8 additions and 0 deletions
|
@ -57,6 +57,14 @@ impl<'a> FnKind<'a> {
|
||||||
FnKind::Closure(attrs) => attrs,
|
FnKind::Closure(attrs) => attrs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn header(&self) -> Option<FnHeader> {
|
||||||
|
match *self {
|
||||||
|
FnKind::ItemFn(_, _, header, _, _) => Some(header),
|
||||||
|
FnKind::Method(_, sig, _, _) => Some(sig.header),
|
||||||
|
FnKind::Closure(_) => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specifies what nested things a visitor wants to visit. The most
|
/// Specifies what nested things a visitor wants to visit. The most
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue