Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Nov 2, 2023
1 parent f5e3f51 commit f660590
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions nextest-runner/src/reporter/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ impl<'cfg> MetadataJunit<'cfg> {
// we may have to update this format to handle that.
let is_success = main_status.result.is_success();

if !is_success
|| (junit_store_success_output && is_success)
|| (junit_store_failure_output && !is_success)
{
if !is_success || junit_store_success_output {
let stdout = main_status.output.stdout_lossy();
let stderr = main_status.output.stderr_lossy();

Expand Down
8 changes: 5 additions & 3 deletions nextest-runner/src/test_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ pub struct TestOutputAccumulator {

impl TestOutputAccumulator {
/// Creates a new test accumulator to capture output from a child process
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
buf: BytesMut::with_capacity(4 * 1024),
Expand All @@ -139,7 +140,7 @@ impl TestOutputAccumulator {
/// Gets a writer the can be used to write to the accumulator as if a child
/// process was writing to stdout
#[inline]
pub fn stdout<'acc>(&'acc mut self) -> TestOutputWriter<'acc> {
pub fn stdout(&mut self) -> TestOutputWriter<'_> {
TestOutputWriter {
acc: self,
stdout: true,
Expand All @@ -149,7 +150,7 @@ impl TestOutputAccumulator {
/// Gets a writer the can be used to write to the accumulator as if a child
/// process was writing to stderr
#[inline]
pub fn stderr<'acc>(&'acc mut self) -> TestOutputWriter<'acc> {
pub fn stderr(&mut self) -> TestOutputWriter<'_> {
TestOutputWriter {
acc: self,
stdout: false,
Expand Down Expand Up @@ -192,6 +193,7 @@ impl<'acc> std::fmt::Write for TestOutputWriter<'acc> {
}

/// Collects the stdout and/or stderr streams into a single buffer
#[allow(clippy::needless_lifetimes, clippy::let_and_return)]
pub fn collect_test_output<'a>(
mut stdout: Option<tokio::process::ChildStdout>,
mut stderr: Option<tokio::process::ChildStderr>,
Expand Down Expand Up @@ -234,7 +236,7 @@ pub fn collect_test_output<'a>(
}
}

return Ok(());
Ok(())
};

read_loop
Expand Down

0 comments on commit f660590

Please sign in to comment.