Add crate_name method to Rustdoc and Rustc

This commit is contained in:
Guillaume Gomez 2024-05-11 20:32:19 +02:00
parent 23e965eb68
commit 4a00debfef
2 changed files with 14 additions and 0 deletions

View file

@ -176,6 +176,13 @@ impl Rustc {
self
}
/// Specify the crate name.
pub fn crate_name(&mut self, name: &str) -> &mut Self {
self.cmd.arg("--crate-name");
self.cmd.arg(name);
self
}
/// Get the [`Output`][::std::process::Output] of the finished process.
#[track_caller]
pub fn command_output(&mut self) -> ::std::process::Output {

View file

@ -114,6 +114,13 @@ impl Rustdoc {
self
}
/// Specify the crate name.
pub fn crate_name(&mut self, name: &str) -> &mut Self {
self.cmd.arg("--crate-name");
self.cmd.arg(name);
self
}
#[track_caller]
pub fn run_fail_assert_exit_code(&mut self, code: i32) -> Output {
let caller_location = std::panic::Location::caller();