use alloc::string::String;
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct Derive {
pub path: String,
pub cfg: Option<String>,
}
impl Derive {
#[must_use]
pub fn new(path: &str) -> Self {
Self { path: String::from(path), cfg: None }
}
#[must_use]
pub fn with_cfg(self, cfg: &str) -> Self {
Self { cfg: Some(String::from(cfg)), ..self }
}
}
impl From<&str> for Derive {
fn from(path: &str) -> Self {
Self::new(path)
}
}
impl From<String> for Derive {
fn from(path: String) -> Self {
Self { path, cfg: None }
}
}