Add use for Unexpected
In preparation for running the formatter on `src/` and a function local
use statement for `$crate::serde:🇩🇪:Unexpected`, this shortens the
line of code that uses this type preventing the formatter for later
munging that line.
This commit is contained in:
parent
fd217e72c3
commit
743b197124
|
@ -431,10 +431,12 @@ macro_rules! impl_bytes_newtype {
|
|||
where
|
||||
E: $crate::serde::de::Error,
|
||||
{
|
||||
use $crate::serde::de::Unexpected;
|
||||
|
||||
if let Ok(hex) = core::str::from_utf8(v) {
|
||||
$crate::hashes::hex::FromHex::from_hex(hex).map_err(E::custom)
|
||||
} else {
|
||||
return Err(E::invalid_value($crate::serde::de::Unexpected::Bytes(v), &self));
|
||||
return Err(E::invalid_value(Unexpected::Bytes(v), &self));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue