Skip to content

Commit b5c641f

Browse files
committed
Add use for Unexpected
In preparation for running the formatter on `src/` and a function local use statement for `$crate::serde::de::Unexpected`, this shortens the line of code that uses this type preventing the formatter for later munging that line.
1 parent 9fa8914 commit b5c641f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/internal_macros.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,12 @@ macro_rules! impl_bytes_newtype {
431431
where
432432
E: $crate::serde::de::Error,
433433
{
434+
use $crate::serde::de::Unexpected;
435+
434436
if let Ok(hex) = core::str::from_utf8(v) {
435437
$crate::hashes::hex::FromHex::from_hex(hex).map_err(E::custom)
436438
} else {
437-
return Err(E::invalid_value($crate::serde::de::Unexpected::Bytes(v), &self));
439+
return Err(E::invalid_value(Unexpected::Bytes(v), &self));
438440
}
439441
}
440442

0 commit comments

Comments
 (0)