mirror of
https://github.com/serde-rs/json.git
synced 2025-10-02 07:21:29 +00:00
Replace integer to_string with itoa
This commit is contained in:
parent
59112ae7b1
commit
4921906b1d
@ -702,7 +702,7 @@ impl From<ParserNumber> for Number {
|
||||
}
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
{
|
||||
u.to_string()
|
||||
itoa::Buffer::new().format(u).to_owned()
|
||||
}
|
||||
}
|
||||
ParserNumber::I64(i) => {
|
||||
@ -712,7 +712,7 @@ impl From<ParserNumber> for Number {
|
||||
}
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
{
|
||||
i.to_string()
|
||||
itoa::Buffer::new().format(i).to_owned()
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "arbitrary_precision")]
|
||||
|
@ -490,43 +490,43 @@ impl serde::Serializer for MapKeySerializer {
|
||||
}
|
||||
|
||||
fn serialize_i8(self, value: i8) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_i16(self, value: i16) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_i32(self, value: i32) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_i64(self, value: i64) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_i128(self, value: i128) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_u8(self, value: u8) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_u16(self, value: u16) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_u32(self, value: u32) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_u64(self, value: u64) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_u128(self, value: u128) -> Result<String> {
|
||||
Ok(value.to_string())
|
||||
Ok(itoa::Buffer::new().format(value).to_owned())
|
||||
}
|
||||
|
||||
fn serialize_f32(self, value: f32) -> Result<String> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user