Skip to content

Commit

Permalink
clippy: drop unneeded vec!
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddrysdale committed Sep 25, 2023
1 parent 07b8b28 commit c11fa8e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/common/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn test_label_sort() {

#[test]
fn test_label_decode_fail() {
let tests = vec![
let tests = [
("43010203", "expected int/tstr"),
("", "decode CBOR failure: Io(EndOfFile"),
("1e", "decode CBOR failure: Syntax"),
Expand Down Expand Up @@ -182,7 +182,7 @@ fn test_registered_label_sort() {

#[test]
fn test_registered_label_decode_fail() {
let tests = vec![
let tests = [
("43010203", "expected int/tstr"),
("", "decode CBOR failure: Io(EndOfFile"),
("09", "expected recognized IANA value"),
Expand Down Expand Up @@ -292,7 +292,7 @@ fn test_registered_label_with_private_sort() {

#[test]
fn test_registered_label_with_private_decode_fail() {
let tests = vec![
let tests = [
("43010203", "expected int/tstr"),
("", "decode CBOR failure: Io(EndOfFile"),
("09", "expected value in IANA or private use range"),
Expand Down Expand Up @@ -325,7 +325,7 @@ const CBOR_INT_OUT_OF_RANGE_HEX: &str = "1b8000000000000000";

#[test]
fn test_large_label_decode() {
let tests = vec![(CBOR_NINT_MIN_HEX, i64::MIN), (CBOR_INT_MAX_HEX, i64::MAX)];
let tests = [(CBOR_NINT_MIN_HEX, i64::MIN), (CBOR_INT_MAX_HEX, i64::MAX)];
for (label_data, want) in tests.iter() {
let data = hex::decode(label_data).unwrap();
let got = Label::from_slice(&data).unwrap();
Expand All @@ -335,7 +335,7 @@ fn test_large_label_decode() {

#[test]
fn test_large_label_decode_fail() {
let tests = vec![
let tests = [
(CBOR_NINT_OUT_OF_RANGE_HEX, "out of range integer value"),
(CBOR_INT_OUT_OF_RANGE_HEX, "out of range integer value"),
];
Expand All @@ -348,7 +348,7 @@ fn test_large_label_decode_fail() {

#[test]
fn test_large_registered_label_decode_fail() {
let tests = vec![
let tests = [
(CBOR_NINT_OUT_OF_RANGE_HEX, "out of range integer value"),
(CBOR_INT_OUT_OF_RANGE_HEX, "out of range integer value"),
];
Expand All @@ -361,7 +361,7 @@ fn test_large_registered_label_decode_fail() {

#[test]
fn test_large_registered_label_with_private_decode_fail() {
let tests = vec![
let tests = [
(CBOR_NINT_OUT_OF_RANGE_HEX, "out of range integer value"),
(CBOR_INT_OUT_OF_RANGE_HEX, "out of range integer value"),
];
Expand Down
6 changes: 3 additions & 3 deletions src/encrypt/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn test_cose_recipient_decode() {

#[test]
fn test_cose_recipient_decode_fail() {
let tests = vec![
let tests = [
(
concat!(
"a2", // 2-map (should be tuple)
Expand Down Expand Up @@ -184,7 +184,7 @@ fn test_cose_encrypt_decode() {

#[test]
fn test_cose_encrypt_decode_fail() {
let tests = vec![
let tests = [
(
concat!(
"a2", // 2-map (should be tuple)
Expand Down Expand Up @@ -518,7 +518,7 @@ fn test_cose_encrypt0_decode() {

#[test]
fn test_cose_encrypt0_decode_fail() {
let tests = vec![
let tests = [
(
concat!(
"a2", // 2-map (should be tuple)
Expand Down
2 changes: 1 addition & 1 deletion src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn test_header_decode_fail() {

#[test]
fn test_header_decode_dup_fail() {
let tests = vec![
let tests = [
(
concat!(
"a3", // 3-map
Expand Down
4 changes: 2 additions & 2 deletions src/key/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ fn test_cose_key_decode_fail() {

#[test]
fn test_cose_keyset_decode_fail() {
let tests = vec![(
let tests = [(
concat!(
"a1", // 1-map
"a1", // 1-map
Expand All @@ -587,7 +587,7 @@ fn test_cose_keyset_decode_fail() {

#[test]
fn test_cose_key_decode_dup_fail() {
let tests = vec![
let tests = [
(
concat!(
"a3", // 3-map
Expand Down
2 changes: 1 addition & 1 deletion src/mac/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ fn test_cose_mac0_decode() {
}
#[test]
fn test_cose_mac0_decode_fail() {
let tests = vec![
let tests = [
(
concat!(
"a2", // 2-map (should be tuple)
Expand Down

0 comments on commit c11fa8e

Please sign in to comment.