mirror of
https://gitee.com/openharmony/third_party_rust_log
synced 2024-11-23 07:40:08 +00:00
Back to u64
This commit is contained in:
parent
2d66fe4ce3
commit
caaa559a23
@ -61,13 +61,13 @@ impl<'de> Deserialize<'de> for Level {
|
||||
self.visit_str(variant)
|
||||
}
|
||||
|
||||
fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>
|
||||
fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
|
||||
where
|
||||
E: Error,
|
||||
{
|
||||
let variant = LOG_LEVEL_NAMES[1..]
|
||||
.get(v as usize)
|
||||
.ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v as u64), &self))?;
|
||||
.ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?;
|
||||
|
||||
self.visit_str(variant)
|
||||
}
|
||||
@ -156,13 +156,13 @@ impl<'de> Deserialize<'de> for LevelFilter {
|
||||
self.visit_str(variant)
|
||||
}
|
||||
|
||||
fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>
|
||||
fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
|
||||
where
|
||||
E: Error,
|
||||
{
|
||||
let variant = LOG_LEVEL_NAMES
|
||||
.get(v as usize)
|
||||
.ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v as u64), &self))?;
|
||||
.ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?;
|
||||
|
||||
self.visit_str(variant)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user