rulewright 0.1.1

Executable engineering standards for Rust workspaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use ra_ap_syntax::{
    AstNode,
    ast::{self, HasModuleItem},
};

pub(super) fn item_lists(root: &ast::SourceFile) -> impl Iterator<Item = Vec<ast::Item>> + '_ {
    std::iter::once(root.items().collect()).chain(
        root.syntax()
            .descendants()
            .filter_map(ast::ItemList::cast)
            .map(|list| list.items().collect()),
    )
}