Skip to content

Commit fbe5015

Browse files
committed
Fix documentation for impl_common_helpers in run-make-support
1 parent b3ca6ee commit fbe5015

File tree

1 file changed

+6
-14
lines changed
  • src/tools/run-make-support/src

1 file changed

+6
-14
lines changed

src/tools/run-make-support/src/lib.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -318,38 +318,30 @@ pub fn run_in_tmpdir<F: FnOnce()>(callback: F) {
318318
}
319319

320320
/// Implement common helpers for command wrappers. This assumes that the command wrapper is a struct
321-
/// containing a `cmd: Command` field and a `output` function. The provided helpers are:
321+
/// containing a `cmd: Command` field. The provided helpers are:
322322
///
323323
/// 1. Generic argument acceptors: `arg` and `args` (delegated to [`Command`]). These are intended
324324
/// to be *fallback* argument acceptors, when specific helpers don't make sense. Prefer to add
325325
/// new specific helper methods over relying on these generic argument providers.
326326
/// 2. Environment manipulation methods: `env`, `env_remove` and `env_clear`: these delegate to
327327
/// methods of the same name on [`Command`].
328-
/// 3. Output and execution: `output`, `run` and `run_fail` are provided. `output` waits for the
329-
/// command to finish running and returns the process's [`Output`]. `run` and `run_fail` are
330-
/// higher-level convenience methods which waits for the command to finish running and assert
331-
/// that the command successfully ran or failed as expected. Prefer `run` and `run_fail` when
332-
/// possible.
328+
/// 3. Output and execution: `run` and `run_fail` are provided. These are
329+
/// higher-level convenience methods which wait for the command to finish running and assert
330+
/// that the command successfully ran or failed as expected. They return
331+
/// [`CompletedProcess`], which can be used to assert the stdout/stderr/exit code of the executed
332+
/// process.
333333
///
334334
/// Example usage:
335335
///
336336
/// ```ignore (illustrative)
337337
/// struct CommandWrapper { cmd: Command } // <- required `cmd` field
338338
///
339-
/// impl CommandWrapper {
340-
/// /// Get the [`Output`][::std::process::Output] of the finished process.
341-
/// pub fn command_output(&mut self) -> Output { /* ... */ } // <- required `command_output()` method
342-
/// }
343-
///
344339
/// crate::impl_common_helpers!(CommandWrapper);
345340
///
346341
/// impl CommandWrapper {
347342
/// // ... additional specific helper methods
348343
/// }
349344
/// ```
350-
///
351-
/// [`Command`]: ::std::process::Command
352-
/// [`Output`]: ::std::process::Output
353345
macro_rules! impl_common_helpers {
354346
($wrapper: ident) => {
355347
impl $wrapper {

0 commit comments

Comments
 (0)