From f748ca8ce4a7b647d68bb7a50c27209152b2293a Mon Sep 17 00:00:00 2001 From: Mingun Date: Sat, 5 Aug 2023 21:28:46 +0500 Subject: [PATCH] Implement deserialize_float using deserialize_integer thus we can be sure that all integers also would be handled when floats are requested --- serde/src/private/de.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/serde/src/private/de.rs b/serde/src/private/de.rs index 958602747..6accc2b5d 100644 --- a/serde/src/private/de.rs +++ b/serde/src/private/de.rs @@ -331,15 +331,7 @@ mod content { match *self { Content::F32(v) => visitor.visit_f32(v), Content::F64(v) => visitor.visit_f64(v), - Content::U8(v) => visitor.visit_u8(v), - Content::U16(v) => visitor.visit_u16(v), - Content::U32(v) => visitor.visit_u32(v), - Content::U64(v) => visitor.visit_u64(v), - Content::I8(v) => visitor.visit_i8(v), - Content::I16(v) => visitor.visit_i16(v), - Content::I32(v) => visitor.visit_i32(v), - Content::I64(v) => visitor.visit_i64(v), - _ => Err(self.invalid_type(&visitor)), + _ => self.deserialize_integer(visitor), } } }