diff --git a/src/lib.rs b/src/lib.rs index a0e2bc1..6802e54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,28 +69,28 @@ impl RustcBuilder { self.edition = Some(edition); self } - pub fn out_dir(mut self, out_dir: PathBuf) -> Self { - self.out_dir = Some(out_dir); + pub fn out_dir(mut self, out_dir: impl Into) -> Self { + self.out_dir = Some(out_dir.into()); self } - pub fn lib_dir(mut self, lib_dir: PathBuf) -> Self { - self.lib_dir = Some(lib_dir); + pub fn lib_dir(mut self, lib_dir: impl Into) -> Self { + self.lib_dir = Some(lib_dir.into()); self } - pub fn crate_name(mut self, crate_name: String) -> Self { - self.crate_name = Some(crate_name); + pub fn crate_name(mut self, crate_name: impl Into) -> Self { + self.crate_name = Some(crate_name.into()); self } pub fn crate_type(mut self, crate_type: CrateType) -> Self { self.crate_type = Some(crate_type); self } - pub fn cfg(mut self, cfg: String) -> Self { - self.cfg.push(cfg); + pub fn cfg(mut self, cfg: impl Into) -> Self { + self.cfg.push(cfg.into()); self } - pub fn externs(mut self, r#extern: String) -> Self { - self.externs.push(r#extern); + pub fn externs(mut self, r#extern: impl Into) -> Self { + self.externs.push(r#extern.into()); self } diff --git a/src/main.rs b/src/main.rs index 67987dc..775b5f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,20 +22,20 @@ fn main() -> Result<(), Box> { Rustc::builder() .edition(Edition::E2021) .crate_type(CrateType::Lib) - .crate_name("freight".into()) + .crate_name("freight") .out_dir(bootstrap_dir.clone()) .lib_dir(bootstrap_dir.clone()) - .cfg("stage1".into()) + .cfg("stage1") .done() .run("src/lib.rs")?; Rustc::builder() .edition(Edition::E2021) .crate_type(CrateType::Bin) - .crate_name("freight_stage1".into()) + .crate_name("freight_stage1") .out_dir(bootstrap_dir.clone()) .lib_dir(bootstrap_dir) - .cfg("stage1".into()) - .externs("freight".into()) + .cfg("stage1") + .externs("freight") .done() .run("src/main.rs")?;