feature-scope 0.2.0

A helper library that enables workspace crates to independently control their required features without cross-package interference
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use syn::{
    parse::{Parse, ParseStream},
    Ident,
};

#[derive(Debug, Clone)]
pub struct FeatureScope {
    pub ident: Ident,
}

impl Parse for FeatureScope {
    fn parse(input: ParseStream) -> syn::Result<Self> {
        let ident: Ident = input.parse()?;
        let ident = Ident::new(&format!("__scope_{}", ident), ident.span());
        Ok(FeatureScope { ident })
    }
}