mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 04:48:20 +02:00
Reduce again the number of match calls (#7815)
- Reduce the number of match calls (see commit messages) - A few miscellaneous improvements
This commit is contained in:
@ -99,17 +99,14 @@ impl Executable for Director {
|
||||
}
|
||||
}
|
||||
|
||||
let process = match binary
|
||||
let process = binary
|
||||
.construct()
|
||||
.stdout(Stdio::piped())
|
||||
// .stdin(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.arg(format!("-c '{}'", commands))
|
||||
.spawn()
|
||||
{
|
||||
Ok(child) => child,
|
||||
Err(why) => panic!("Can't run test {}", why),
|
||||
};
|
||||
.expect("It should be possible to run tests");
|
||||
|
||||
process
|
||||
.wait_with_output()
|
||||
|
@ -48,10 +48,8 @@ impl CheckerMatchers for Play {
|
||||
Some(out) => out,
|
||||
None => return Ok(()),
|
||||
};
|
||||
let actual = match str::from_utf8(actual) {
|
||||
Err(..) => return Err(format!("{} was not utf8 encoded", description)),
|
||||
Ok(actual) => actual,
|
||||
};
|
||||
let actual =
|
||||
str::from_utf8(actual).map_err(|_| format!("{} was not utf8 encoded", description))?;
|
||||
|
||||
if actual != *out {
|
||||
return Err(format!(
|
||||
|
Reference in New Issue
Block a user