diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e4ce2ab..3cce40e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -58,6 +58,12 @@ jobs: command: clippy args: -- -D warnings + - name: Run cargo clippy on tests + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --tests -- -D warnings + test: name: Test Suite runs-on: ${{ matrix.os }} diff --git a/src/io/mod.rs b/src/io/mod.rs index 58e7eb9..ae8e2af 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -365,7 +365,7 @@ mod tests { let io = Io::default(); io.write_lines(&f1, &lines).unwrap(); let strings: Vec = lines.iter().map(|l| l.to_string()).collect(); - io.write_lines(&f2, &strings).unwrap(); + io.write_lines(&f2, strings).unwrap(); let r1 = io.read_lines(&f1).unwrap(); let r2 = io.read_lines(&f2).unwrap(); @@ -382,8 +382,8 @@ mod tests { let gzipped = tempdir.path().join("gzipped.txt.gz"); let io = Io::default(); - io.write_lines(&text, &mut lines.iter()).unwrap(); - io.write_lines(&gzipped, &mut lines.iter()).unwrap(); + io.write_lines(&text, lines.iter()).unwrap(); + io.write_lines(&gzipped, lines.iter()).unwrap(); let r1 = io.read_lines(&text).unwrap(); let r2 = io.read_lines(&gzipped).unwrap(); diff --git a/src/iter/mod.rs b/src/iter/mod.rs index 71e7452..c376c73 100644 --- a/src/iter/mod.rs +++ b/src/iter/mod.rs @@ -230,7 +230,7 @@ mod tests { #[case] chunk_size: usize, #[case] buffer_size: usize, ) { - let test_vec: Vec = (0..1_000_000).into_iter().collect(); + let test_vec: Vec = (0..1_000_000).collect(); let test_vec2 = test_vec.clone(); let mut regular_iter = test_vec.into_iter(); @@ -249,7 +249,7 @@ mod tests { #[test] fn test_low_bound_on_channel_for_blocking() { - let chunked_iter = (0..100_000).into_iter().read_ahead(8, 1); + let chunked_iter = (0..100_000).read_ahead(8, 1); for i in chunked_iter { // Do some work so iter will get consumed let _ = i % 2; @@ -375,7 +375,7 @@ mod tests { #[test] #[should_panic(expected = "expected error message")] fn test_panic_occurring_mid_chunk_returns_results_until_panic() { - let mut test_iter = FailingIter::new().into_iter().read_ahead(8, 1); + let mut test_iter = FailingIter::new().read_ahead(8, 1); for _ in 0..FAIL_POINT { panic::catch_unwind(AssertUnwindSafe(|| { @@ -419,7 +419,7 @@ mod tests { #[should_panic(expected = "expected error message")] fn test_panic_occurring_after_iteration_raises() { { - let mut test_iter = ExitFailingIter::new().into_iter().read_ahead(8, 1); + let mut test_iter = ExitFailingIter::new().read_ahead(8, 1); for _ in 0..FAIL_POINT { panic::catch_unwind(AssertUnwindSafe(|| {