I am trying to use syn::parse_file function from syn crate.
But, I unable to use it and found a function in the crate with feature attribute:
#[cfg(all(feature = "parsing", feature = "full"))]
#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "full"))))]
pub fn parse_file(mut content: &str) -> Result<File> {
// other code
}
Unable to find any discription of this feature.
How do I enable these features in my project?
And use this function.
You can enable a certain crate feature in the
Cargo.tomlfile - where you specify the crate itself and its version.For the syn crate, the
parsingfeature is enabled by default butfullis not, as described in the docs.Here you can read more about how to enable features for your crates (dependencies).