convenience api

This commit is contained in:
Aleksey Kladov 2019-07-19 19:05:34 +03:00
parent a6df224f7d
commit 191a6ba330
8 changed files with 63 additions and 50 deletions

View file

@ -155,7 +155,7 @@ pub struct CommentIter {
impl Iterator for CommentIter {
type Item = ast::Comment;
fn next(&mut self) -> Option<ast::Comment> {
self.iter.by_ref().find_map(|el| el.as_token().cloned().and_then(ast::Comment::cast))
self.iter.by_ref().find_map(|el| el.into_token().and_then(ast::Comment::cast))
}
}