Skip to content

Commit 80e7cbf

Browse files
author
Andrew
committed
clippy 1
1 parent ca51553 commit 80e7cbf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dsc_lib/src/dscresources/command_resource.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ async fn run_process_async(executable: &str, args: Option<Vec<String>>, input: O
588588
if let Some(input) = input {
589589
trace!("Writing to command STDIN: {input}");
590590
let mut stdin = child.stdin.take().expect("child did not have a handle to stdin");
591-
stdin.write(input.as_bytes()).await.expect("could not write to stdin");
591+
stdin.write_all(input.as_bytes()).await.expect("could not write to stdin");
592592
drop(stdin);
593593
}
594594

@@ -609,7 +609,7 @@ async fn run_process_async(executable: &str, args: Option<Vec<String>>, input: O
609609
stdout_result.push_str(&line);
610610
stdout_result.push('\n');
611611
}
612-
return stdout_result
612+
stdout_result
613613
});
614614

615615
let stderr_task = tokio::spawn(async move {
@@ -621,7 +621,7 @@ async fn run_process_async(executable: &str, args: Option<Vec<String>>, input: O
621621
filtered_stderr.push('\n');
622622
}
623623
}
624-
return filtered_stderr
624+
filtered_stderr
625625
});
626626

627627
let exit_code = child_task.await.unwrap()?.code();
@@ -641,10 +641,11 @@ async fn run_process_async(executable: &str, args: Option<Vec<String>>, input: O
641641
return Err(DscError::Command(executable.to_string(), code, stderr_result));
642642
}
643643

644-
Ok((code, stdout_result, stderr_result)) },
644+
Ok((code, stdout_result, stderr_result))
645+
},
645646
None => {
646647
debug!("Process '{executable}' id {child_id} terminated by signal");
647-
return Err(DscError::CommandOperation("Process terminated by signal".to_string(), executable.to_string()));
648+
Err(DscError::CommandOperation("Process terminated by signal".to_string(), executable.to_string()))
648649
}
649650
}
650651
}
@@ -840,5 +841,5 @@ pub fn log_stderr_line<'a>(process_id: &u32, trace_line: &'a str) -> &'a str
840841
}
841842
};
842843

843-
return "";
844+
""
844845
}

0 commit comments

Comments
 (0)