(item_use: &'a syn::ItemUse, mut f: F)
| 680 | } |
| 681 | |
| 682 | pub(crate) fn iter_use_idents<'a, F, R: 'a>(item_use: &'a syn::ItemUse, mut f: F) -> Result<Vec<R>> |
| 683 | where |
| 684 | F: FnMut(&'a syn::Ident, bool) -> Result<R>, |
| 685 | { |
| 686 | let mut result = Vec::new(); |
| 687 | match &item_use.tree { |
| 688 | UseTree::Name(name) => result.push(f(&name.ident, true)?), |
| 689 | UseTree::Rename(rename) => result.push(f(&rename.rename, true)?), |
| 690 | UseTree::Path(path) => match &*path.tree { |
| 691 | UseTree::Name(name) => result.push(f(&name.ident, true)?), |
| 692 | UseTree::Rename(rename) => result.push(f(&rename.rename, true)?), |
| 693 | other => iter_use_tree_idents(other, &mut result, &mut f)?, |
| 694 | }, |
| 695 | other => iter_use_tree_idents(other, &mut result, &mut f)?, |
| 696 | } |
| 697 | Ok(result) |
| 698 | } |
| 699 | |
| 700 | fn iter_use_tree_idents<'a, F, R: 'a>( |
| 701 | tree: &'a syn::UseTree, |
no test coverage detected