echoes 0.10.2

Find duplicated Rust doctests, functions and contexts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// The named inherent method of one file.
pub(super) fn impl_method<'a>(source: &'a syn::File, name: &str) -> &'a syn::ImplItemFn {
    source
        .items
        .iter()
        .find_map(|item| match item {
            syn::Item::Impl(item) => item.items.iter().find_map(|member| match member {
                syn::ImplItem::Fn(function) if function.sig.ident == name => Some(function),
                _ => None,
            }),
            _ => None,
        })
        .unwrap()
}