Skip to content

Tweak SanitizedOutput style #4205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/test/mock/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
process::Command,
string::FromUtf8Error,
sync::{Arc, LazyLock, RwLock, RwLockWriteGuard},
time::Instant,
};
Expand Down Expand Up @@ -764,7 +765,7 @@ impl Config {
};
let duration = Instant::now() - start;
let status = out.status;
let output: SanitizedOutput = out.try_into().unwrap();
let output = SanitizedOutput::try_from(out).unwrap();

println!("ran: {} {:?}", name, args);
println!("inprocess: {inprocess}");
Expand Down Expand Up @@ -918,14 +919,14 @@ pub struct SanitizedOutput {
}

impl TryFrom<Output> for SanitizedOutput {
type Error = std::string::FromUtf8Error;
type Error = FromUtf8Error;

fn try_from(out: Output) -> Result<Self, Self::Error> {
let sanitized_output = Self {
Ok(Self {
ok: matches!(out.status, Some(0)),
stdout: String::from_utf8(out.stdout)?,
stderr: String::from_utf8(out.stderr)?,
};
Ok(sanitized_output)
})
}
}

Expand Down
Loading