Skip to content

Commit

Permalink
Fix new clippy warnings (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor authored Jul 20, 2023
1 parent e9d1906 commit d91a3ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
21 changes: 14 additions & 7 deletions exercises/practice/paasio/tests/paasio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ macro_rules! test_read {
#[test]
fn test_read_passthrough() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut reader = ReadStats::new(data);

let mut buffer = Vec::with_capacity(size);
Expand All @@ -31,7 +32,8 @@ macro_rules! test_read {
#[test]
fn test_read_chunks() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut reader = ReadStats::new(data);

let mut buffer = [0_u8; CHUNK_SIZE];
Expand All @@ -51,7 +53,8 @@ macro_rules! test_read {
#[test]
fn test_read_buffered_chunks() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut reader = BufReader::new(ReadStats::new(data));

let mut buffer = [0_u8; CHUNK_SIZE];
Expand Down Expand Up @@ -84,7 +87,8 @@ macro_rules! test_write {
#[test]
fn test_write_passthrough() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut writer = WriteStats::new(Vec::with_capacity(size));
let written = writer.write(data);
assert!(written.is_ok());
Expand All @@ -98,7 +102,8 @@ macro_rules! test_write {
#[test]
fn test_sink_oneshot() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut writer = WriteStats::new(io::sink());
let written = writer.write(data);
assert!(written.is_ok());
Expand All @@ -111,7 +116,8 @@ macro_rules! test_write {
#[test]
fn test_sink_windowed() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut writer = WriteStats::new(io::sink());

let mut chunk_count = 0;
Expand All @@ -129,7 +135,8 @@ macro_rules! test_write {
#[test]
fn test_sink_buffered_windowed() {
let data = $input;
let size = $len(&data);
let len = $len;
let size = len(&data);
let mut writer = BufWriter::new(WriteStats::new(io::sink()));

for chunk in data.chunks(CHUNK_SIZE) {
Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/proverb/tests/proverb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use proverb::build_proverb;
#[test]
fn test_two_pieces() {
let input = vec!["nail", "shoe"];
let expected = vec![
let expected = [
"For want of a nail the shoe was lost.",
"And all for the want of a nail.",
]
Expand All @@ -16,7 +16,7 @@ fn test_two_pieces() {
#[ignore]
fn test_three_pieces() {
let input = vec!["nail", "shoe", "horse"];
let expected = vec![
let expected = [
"For want of a nail the shoe was lost.",
"For want of a shoe the horse was lost.",
"And all for the want of a nail.",
Expand Down Expand Up @@ -47,7 +47,7 @@ fn test_full() {
let input = vec![
"nail", "shoe", "horse", "rider", "message", "battle", "kingdom",
];
let expected = vec![
let expected = [
"For want of a nail the shoe was lost.",
"For want of a shoe the horse was lost.",
"For want of a horse the rider was lost.",
Expand All @@ -64,7 +64,7 @@ fn test_full() {
#[ignore]
fn test_three_pieces_modernized() {
let input = vec!["pin", "gun", "soldier", "battle"];
let expected = vec![
let expected = [
"For want of a pin the gun was lost.",
"For want of a gun the soldier was lost.",
"For want of a soldier the battle was lost.",
Expand Down

0 comments on commit d91a3ca

Please sign in to comment.