Skip to content

Commit

Permalink
Implement deserialize_float using deserialize_integer
Browse files Browse the repository at this point in the history
thus we can be sure that all integers also would be handled when floats are requested
  • Loading branch information
Mingun committed Aug 6, 2023
1 parent 12009c9 commit f748ca8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions serde/src/private/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
}
Expand Down

0 comments on commit f748ca8

Please sign in to comment.