Skip to content

Commit

Permalink
fix some warning about unused variables in panic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimexist committed Oct 31, 2021
1 parent 2310936 commit d2bdcae
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions arrow/src/array/array_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ mod tests {
.build()
.unwrap();
let list_array = ListArray::from(array_data);
BinaryArray::from(list_array);
drop(BinaryArray::from(list_array));
}

#[test]
Expand Down Expand Up @@ -1217,7 +1217,7 @@ mod tests {
.build()
.unwrap();
let list_array = FixedSizeListArray::from(array_data);
FixedSizeBinaryArray::from(list_array);
drop(FixedSizeBinaryArray::from(list_array));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,6 @@ mod tests {
.len(5)
.build()
.unwrap();
BooleanArray::from(data);
drop(BooleanArray::from(data));
}
}
12 changes: 6 additions & 6 deletions arrow/src/array/array_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ mod tests {
.add_child_data(value_data)
.build()
.unwrap();
FixedSizeListArray::from(list_data);
drop(FixedSizeListArray::from(list_data));
}

#[test]
Expand Down Expand Up @@ -1050,7 +1050,7 @@ mod tests {
.add_child_data(value_data)
.build()
.unwrap();
ListArray::from(list_data);
drop(ListArray::from(list_data));
}

#[test]
Expand All @@ -1066,7 +1066,7 @@ mod tests {
.add_buffer(value_offsets)
.build()
.unwrap();
ListArray::from(list_data);
drop(ListArray::from(list_data));
}

#[test]
Expand All @@ -1088,7 +1088,7 @@ mod tests {
.add_child_data(value_data)
.build()
.unwrap();
ListArray::from(list_data);
drop(ListArray::from(list_data));
}

#[test]
Expand All @@ -1101,7 +1101,7 @@ mod tests {
.add_buffer(buf2)
.build()
.unwrap();
Int32Array::from(array_data);
drop(Int32Array::from(array_data));
}

#[test]
Expand All @@ -1124,7 +1124,7 @@ mod tests {
.add_child_data(value_data)
.build()
.unwrap();
ListArray::from(list_data);
drop(ListArray::from(list_data));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ mod tests {
(values buffer)")]
fn test_primitive_array_invalid_buffer_len() {
let data = ArrayData::builder(DataType::Int32).len(5).build().unwrap();
Int32Array::from(data);
drop(Int32Array::from(data));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion arrow/src/array/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ mod tests {
#[should_panic(expected = "[Large]StringArray expects Datatype::[Large]Utf8")]
fn test_string_array_from_int() {
let array = LargeStringArray::from(vec!["a", "b"]);
StringArray::from(array.data().clone());
drop(StringArray::from(array.data().clone()));
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions arrow/src/array/array_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ mod tests {
expected = "the field data types must match the array data in a StructArray"
)]
fn test_struct_array_from_mismatched_types() {
StructArray::from(vec![
drop(StructArray::from(vec![
(
Field::new("b", DataType::Int16, false),
Arc::new(BooleanArray::from(vec![false, false, true, true]))
Expand All @@ -418,7 +418,7 @@ mod tests {
Field::new("c", DataType::Utf8, false),
Arc::new(Int32Array::from(vec![42, 28, 19, 31])),
),
]);
]));
}

#[test]
Expand Down Expand Up @@ -515,7 +515,7 @@ mod tests {
expected = "all child arrays of a StructArray must have the same length"
)]
fn test_invalid_struct_child_array_lengths() {
StructArray::from(vec![
drop(StructArray::from(vec![
(
Field::new("b", DataType::Float32, false),
Arc::new(Float32Array::from(vec![1.1])) as Arc<dyn Array>,
Expand All @@ -524,6 +524,6 @@ mod tests {
Field::new("c", DataType::Float64, false),
Arc::new(Float64Array::from(vec![2.2, 3.3])),
),
]);
]));
}
}

0 comments on commit d2bdcae

Please sign in to comment.