diff options
| author | mo8it <mo8it@proton.me> | 2024-05-13 21:40:40 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-05-13 21:40:40 +0200 |
| commit | d48e86b1540dcf649412c088cc50161f3e356e26 (patch) | |
| tree | 4c2e4c833ccb8797795e7a9e2858f6b2d8f140f9 /src/cmd.rs | |
| parent | 39a19f945008ef59af107fe54d9dc62943469c8b (diff) | |
Use public comments for public items
Diffstat (limited to 'src/cmd.rs')
| -rw-r--r-- | src/cmd.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,8 +1,8 @@ use anyhow::{Context, Result}; use std::{io::Read, path::Path, process::Command}; -// Run a command with a description for a possible error and append the merged stdout and stderr. -// The boolean in the returned `Result` is true if the command's exit status is success. +/// Run a command with a description for a possible error and append the merged stdout and stderr. +/// The boolean in the returned `Result` is true if the command's exit status is success. pub fn run_cmd(mut cmd: Command, description: &str, output: &mut Vec<u8>) -> Result<bool> { let (mut reader, writer) = os_pipe::pipe() .with_context(|| format!("Failed to create a pipe to run the command `{description}``"))?; @@ -37,18 +37,18 @@ pub struct CargoCmd<'a> { pub args: &'a [&'a str], pub exercise_name: &'a str, pub description: &'a str, - // RUSTFLAGS="-A warnings" + /// RUSTFLAGS="-A warnings" pub hide_warnings: bool, - // Added as `--target-dir` if `Self::dev` is true. + /// Added as `--target-dir` if `Self::dev` is true. pub target_dir: &'a Path, - // The output buffer to append the merged stdout and stderr. + /// The output buffer to append the merged stdout and stderr. pub output: &'a mut Vec<u8>, - // true while developing Rustlings. + /// true while developing Rustlings. pub dev: bool, } impl<'a> CargoCmd<'a> { - // Run `cargo SUBCOMMAND --bin EXERCISE_NAME … ARGS`. + /// Run `cargo SUBCOMMAND --bin EXERCISE_NAME … ARGS`. pub fn run(&mut self) -> Result<bool> { let mut cmd = Command::new("cargo"); cmd.arg(self.subcommand); |
