INNER CODE UNIT · Rust
default_features
killercup/cargo-edit · src/dependency.rs:144
pub fn default_features(&self) -> Option<bool> {
self.default_features
}
/// Get whether the dep is optional
pub fn optional(&self) -> Option<bool> {
self.optional
}
}
impl Dependency {
/// Create a dependency from a TOML table entry
pub fn from_toml(crate_root: &Path, key: &str, item: &toml_edit::Item) -> CargoResult<Self> {
if let Some(version) = item.as_str() {
let dep = Self::new(key).set_source(RegistrySource::new(version));
Ok(dep)
} else if let Some(table) = item.as_table_like() {
let (name, rename) = if let Some(value) = table.get("package") {