xtask: split run into two functions in cargo.rs
This commit is contained in:
parent
de98ae1082
commit
a45c54faf8
@ -36,7 +36,11 @@ pub enum CargoBuilder<'e> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'e> CargoBuilder<'e> {
|
impl<'e> CargoBuilder<'e> {
|
||||||
pub fn run<P: AsRef<Path>, S: AsRef<OsStr>>(self, dir: P, arg: S) -> Result<(), Error> {
|
fn make_command<P: AsRef<Path>, S: AsRef<OsStr>>(
|
||||||
|
self,
|
||||||
|
dir: P,
|
||||||
|
arg: S,
|
||||||
|
) -> Result<Command, Error> {
|
||||||
let arg = arg.as_ref();
|
let arg = arg.as_ref();
|
||||||
let mut command = Command::new("cargo");
|
let mut command = Command::new("cargo");
|
||||||
|
|
||||||
@ -239,6 +243,12 @@ impl<'e> CargoBuilder<'e> {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(command)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn run<P: AsRef<Path>, S: AsRef<OsStr>>(self, dir: P, arg: S) -> Result<(), Error> {
|
||||||
|
let mut command = self.make_command(dir, arg)?;
|
||||||
|
|
||||||
log::trace!("Run cargo: {:?}", command);
|
log::trace!("Run cargo: {:?}", command);
|
||||||
|
|
||||||
let status = command.status()?;
|
let status = command.status()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user