Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Resolve needless_borrow clippy lints
Browse files Browse the repository at this point in the history
    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_error.rs:20:23
       |
    20 |     test_error::<i16>(&yaml, expected);
       |                       ^^^^^ help: change this to: `yaml`
       |
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_error.rs:45:21
       |
    45 |     test_error::<A>(&yaml, expected);
       |                     ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_error.rs:66:25
       |
    66 |     test_error::<Basic>(&yaml, expected);
       |                         ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_error.rs:76:26
       |
    76 |     test_error::<String>(&yaml, expected);
       |                          ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_error.rs:91:27
       |
    91 |     test_error::<Wrapper>(&yaml, expected);
       |                           ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:103:25
        |
    103 |     test_error::<usize>(&yaml, expected);
        |                         ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:118:21
        |
    118 |     test_error::<E>(&yaml, expected);
        |                     ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:132:21
        |
    132 |     test_error::<E>(&yaml, expected);
        |                     ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:146:21
        |
    146 |     test_error::<E>(&yaml, expected);
        |                     ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:156:24
        |
    156 |     test_error::<bool>(&yaml, expected);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_de.rs:50:13
       |
    50 |     test_de(&yaml, &expected);
       |             ^^^^^ help: change this to: `yaml`
       |
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:166:23
        |
    166 |     test_error::<i64>(&yaml, expected);
        |                       ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:48:24
       |
    48 |     test_serde(&thing, &yaml);
       |                        ^^^^^ help: change this to: `yaml`
       |
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:176:23
        |
    176 |     test_error::<f64>(&yaml, expected);
        |                       ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:58:24
       |
    58 |     test_serde(&thing, &yaml);
       |                        ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:186:22
        |
    186 |     test_error::<()>(&yaml, expected);
        |                      ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:68:24
       |
    68 |     test_serde(&thing, &yaml);
       |                        ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:196:32
        |
    196 |     test_error::<(u8, u8, u8)>(&yaml, expected);
        |                                ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:78:24
       |
    78 |     test_serde(&thing, &yaml);
       |                        ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_error.rs:206:28
        |
    206 |     test_error::<(u8, u8)>(&yaml, expected);
        |                            ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:89:28
       |
    89 |         test_serde(&thing, &yaml);
       |                            ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_serde.rs:99:28
       |
    99 |         test_serde(&thing, &yaml);
       |                            ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:110:24
        |
    110 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:117:24
        |
    117 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:124:24
        |
    124 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:131:24
        |
    131 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:133:43
        |
    133 |       let float: f64 = serde_yaml::from_str(&indoc! {"
        |  ___________________________________________^
    134 | |         ---
    135 | |         .nan
    136 | |     "})
        | |______^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    help: change this to
        |
    133 |     let float: f64 = serde_yaml::from_str("
    134 |         ---
    135 |         .nan
    136 |     ")
        |

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:150:24
        |
    150 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:163:24
        |
    163 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
      --> tests/test_de.rs:71:13
       |
    71 |     test_de(&yaml, &expected);
       |             ^^^^^ help: change this to: `yaml`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:185:24
        |
    185 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:200:24
        |
    200 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:122:13
        |
    122 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:221:24
        |
    221 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:233:24
        |
    233 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:244:24
        |
    244 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:259:24
        |
    259 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:155:13
        |
    155 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:275:24
        |
    275 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:179:13
        |
    179 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:289:24
        |
    289 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:196:13
        |
    196 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:207:59
        |
    207 |         assert_eq!(expected, serde_yaml::from_str::<i128>(&yaml).unwrap());
        |                                                           ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:217:59
        |
    217 |         assert_eq!(expected, serde_yaml::from_str::<u128>(&yaml).unwrap());
        |                                                           ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:306:24
        |
    306 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:237:13
        |
    237 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:327:24
        |
    327 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:265:13
        |
    265 |     test_de(&yaml, &expected);
        |             ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_de.rs:312:55
        |
    312 |     assert_eq!(expected, serde_yaml::from_str::<Data>(&yaml).unwrap());
        |                                                       ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:362:24
        |
    362 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> tests/test_serde.rs:392:24
        |
    392 |     test_serde(&thing, &yaml);
        |                        ^^^^^ help: change this to: `yaml`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
  • Loading branch information
dtolnay committed Jun 5, 2021
1 parent cdf6fb9 commit 4684ca0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
22 changes: 11 additions & 11 deletions tests/test_de.rs
Expand Up @@ -47,7 +47,7 @@ fn test_alias() {
expected.insert(String::from("second"), 1);
expected.insert(String::from("third"), 3);
}
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand All @@ -68,7 +68,7 @@ fn test_option() {
b: None,
c: Some(true),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand Down Expand Up @@ -119,7 +119,7 @@ fn test_option_alias() {
e: Some("x".to_owned()),
f: Some(true),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand Down Expand Up @@ -152,7 +152,7 @@ fn test_enum_alias() {
a: E::A,
b: E::B(1, 2),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand All @@ -176,7 +176,7 @@ fn test_enum_tag() {
a: E::A("foo".into()),
b: E::B("bar".into()),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand All @@ -193,7 +193,7 @@ fn test_number_as_string() {
let expected = Num {
value: "340282366920938463463374607431768211457".to_owned(),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

serde_if_integer128! {
Expand All @@ -204,7 +204,7 @@ serde_if_integer128! {
---
-9223372036854775809
"};
assert_eq!(expected, serde_yaml::from_str::<i128>(&yaml).unwrap());
assert_eq!(expected, serde_yaml::from_str::<i128>(yaml).unwrap());
}

#[test]
Expand All @@ -214,7 +214,7 @@ serde_if_integer128! {
---
18446744073709551616
"};
assert_eq!(expected, serde_yaml::from_str::<u128>(&yaml).unwrap());
assert_eq!(expected, serde_yaml::from_str::<u128>(yaml).unwrap());
}
}

Expand All @@ -234,7 +234,7 @@ fn test_number_alias_as_string() {
version: "1.10".to_owned(),
value: "1.10".to_owned(),
};
test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand Down Expand Up @@ -262,7 +262,7 @@ fn test_de_mapping() {
serde_yaml::Value::String("bar".to_owned()),
);

test_de(&yaml, &expected);
test_de(yaml, &expected);
}

#[test]
Expand Down Expand Up @@ -309,7 +309,7 @@ fn test_bomb() {
expected: "string".to_owned(),
};

assert_eq!(expected, serde_yaml::from_str::<Data>(&yaml).unwrap());
assert_eq!(expected, serde_yaml::from_str::<Data>(yaml).unwrap());
}

#[test]
Expand Down
30 changes: 15 additions & 15 deletions tests/test_error.rs
Expand Up @@ -17,7 +17,7 @@ fn test_incorrect_type() {
str
"};
let expected = "invalid type: string \"str\", expected i16 at line 2 column 1";
test_error::<i16>(&yaml, expected);
test_error::<i16>(yaml, expected);
}

#[test]
Expand All @@ -42,7 +42,7 @@ fn test_incorrect_nested_type() {
"};
let expected =
"b[0].C.d: invalid type: string \"fase\", expected a boolean at line 4 column 10";
test_error::<A>(&yaml, expected);
test_error::<A>(yaml, expected);
}

#[test]
Expand All @@ -63,7 +63,7 @@ fn test_missing_field() {
v: true
"};
let expected = "missing field `w` at line 2 column 2";
test_error::<Basic>(&yaml, expected);
test_error::<Basic>(yaml, expected);
}

#[test]
Expand All @@ -73,7 +73,7 @@ fn test_unknown_anchor() {
*some
"};
let expected = "while parsing node, found unknown anchor at line 2 column 1";
test_error::<String>(&yaml, expected);
test_error::<String>(yaml, expected);
}

#[test]
Expand All @@ -88,7 +88,7 @@ fn test_ignored_unknown_anchor() {
c: ~
"};
let expected = "while parsing node, found unknown anchor at line 2 column 5";
test_error::<Wrapper>(&yaml, expected);
test_error::<Wrapper>(yaml, expected);
}

#[test]
Expand All @@ -100,7 +100,7 @@ fn test_two_documents() {
1
"};
let expected = "deserializing from YAML containing more than one document is not supported";
test_error::<usize>(&yaml, expected);
test_error::<usize>(yaml, expected);
}

#[test]
Expand All @@ -115,7 +115,7 @@ fn test_variant_map_wrong_size() {
"other": 32
"#};
let expected = "invalid length 2, expected map containing 1 entry";
test_error::<E>(&yaml, expected);
test_error::<E>(yaml, expected);
}

#[test]
Expand All @@ -129,7 +129,7 @@ fn test_variant_not_a_map() {
- "V"
"#};
let expected = "invalid type: sequence, expected string or singleton map at line 2 column 1";
test_error::<E>(&yaml, expected);
test_error::<E>(yaml, expected);
}

#[test]
Expand All @@ -143,7 +143,7 @@ fn test_variant_not_string() {
{}: true
"#};
let expected = "invalid type: map, expected variant of enum `E` at line 2 column 1";
test_error::<E>(&yaml, expected);
test_error::<E>(yaml, expected);
}

#[test]
Expand All @@ -153,7 +153,7 @@ fn test_bad_bool() {
!!bool str
"};
let expected = "invalid value: string \"str\", expected a boolean at line 2 column 8";
test_error::<bool>(&yaml, expected);
test_error::<bool>(yaml, expected);
}

#[test]
Expand All @@ -163,7 +163,7 @@ fn test_bad_int() {
!!int str
"};
let expected = "invalid value: string \"str\", expected an integer at line 2 column 7";
test_error::<i64>(&yaml, expected);
test_error::<i64>(yaml, expected);
}

#[test]
Expand All @@ -173,7 +173,7 @@ fn test_bad_float() {
!!float str
"};
let expected = "invalid value: string \"str\", expected a float at line 2 column 9";
test_error::<f64>(&yaml, expected);
test_error::<f64>(yaml, expected);
}

#[test]
Expand All @@ -183,7 +183,7 @@ fn test_bad_null() {
!!null str
"};
let expected = "invalid value: string \"str\", expected null at line 2 column 8";
test_error::<()>(&yaml, expected);
test_error::<()>(yaml, expected);
}

#[test]
Expand All @@ -193,7 +193,7 @@ fn test_short_tuple() {
[0, 0]
"};
let expected = "invalid length 2, expected a tuple of size 3 at line 2 column 1";
test_error::<(u8, u8, u8)>(&yaml, expected);
test_error::<(u8, u8, u8)>(yaml, expected);
}

#[test]
Expand All @@ -203,7 +203,7 @@ fn test_long_tuple() {
[0, 0, 0]
"};
let expected = "invalid length 3, expected sequence of 2 elements at line 2 column 1";
test_error::<(u8, u8)>(&yaml, expected);
test_error::<(u8, u8)>(yaml, expected);
}

#[test]
Expand Down

0 comments on commit 4684ca0

Please sign in to comment.