This commit is contained in:
sagie gur ari 2020-07-03 11:11:44 +00:00
parent 249d4aca3a
commit 0998b3dec9
2 changed files with 3 additions and 2 deletions

View file

@ -19,7 +19,7 @@ fn write_file(reader: &mut dyn Read, target_file: &str) -> Result<(), Error> {
loop {
let read_size = reader.read(&mut buffer)?;
if read_size > 0 {
writer.write(&buffer[0..read_size])?;
writer.write_all(&buffer[0..read_size])?;
} else {
break;
}

View file

@ -81,7 +81,8 @@ pub(crate) fn eval_with_instructions(
} else {
match parse(arguments) {
Ok(instruction) => {
let all_instructions = [&instructions[..], &vec![instruction]].concat();
let mut all_instructions = instructions.clone();
all_instructions.push(instruction);
let (flow_result, flow_output) = eval_instructions(
&all_instructions,
commands,