Skip to content

Commit

Permalink
Tweak borrowed byte array error message
Browse files Browse the repository at this point in the history
This is consistent with the impl for &str. Without this, formats that do not
support borrowing a byte array will produce unhelpful messages that say
unexpected type byte array, expected byte array.
  • Loading branch information
dtolnay committed Sep 8, 2017
1 parent 6a8698c commit 42c1f08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'de> Visitor<'de> for BytesVisitor {
type Value = Bytes<'de>;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("byte array")
formatter.write_str("a borrowed byte array")
}

#[inline]
Expand Down

0 comments on commit 42c1f08

Please sign in to comment.