Remove some vec clones in const-eval

This commit is contained in:
Lukas Wirth 2024-01-06 19:20:13 +01:00
parent 5125063a21
commit 5ac0c14384
8 changed files with 161 additions and 128 deletions

View file

@ -2183,7 +2183,7 @@ impl Function {
return r;
}
};
let (result, stdout, stderr) = interpret_mir(db, body, false, None);
let (result, output) = interpret_mir(db, body, false, None);
let mut text = match result {
Ok(_) => "pass".to_string(),
Err(e) => {
@ -2192,10 +2192,12 @@ impl Function {
r
}
};
let stdout = output.stdout().into_owned();
if !stdout.is_empty() {
text += "\n--------- stdout ---------\n";
text += &stdout;
}
let stderr = output.stdout().into_owned();
if !stderr.is_empty() {
text += "\n--------- stderr ---------\n";
text += &stderr;