pub fn filter(mut content: String, filter: Selector) -> anyhow::Result<String> {
    let mut syntax_tree = syn::parse_file(&content)?;
    syntax_tree.shebang = None;
    syntax_tree.attrs.clear();
    syntax_tree.items = filter.apply_to(&syntax_tree);
    content = quote!(#syntax_tree).to_string();
    Ok(content)
}
/// Applies the filter on the content
Applies the filter on the content
Applies the filter on the content
pub fn filter(mut content: String, filter: Selector) -> anyhow::Result<String> {
    let mut syntax_tree = syn::parse_file(&content)?;
    syntax_tree.shebang = None;
    syntax_tree.attrs.clear();
    syntax_tree.items = filter.apply_to(&syntax_tree);
    content = quote!(#syntax_tree).to_string();
    Ok(content)
}
pub fn filter ( mut content : String , filter : Selector ) -> anyhow :: Result < String > { let mut syntax_tree = syn :: parse_file ( & content ) ? ; syntax_tree . shebang = None ; syntax_tree . attrs . clear ( ) ; syntax_tree . items = filter . apply_to ( & syntax_tree ) ; content = quote ! ( syntax_tree ) . to_string ( ) ; Ok ( content ) }
Applies the filter on the content
Applies the filter on the content
content
String
filter
Selector