mirror of
https://github.com/serde-rs/json.git
synced 2025-10-02 23:35:59 +00:00
Replace char::to_string with encode_utf8
This commit is contained in:
parent
4921906b1d
commit
3f4e30a584
@ -2,7 +2,9 @@
|
||||
|
||||
use crate::error::{Error, ErrorCode, Result};
|
||||
use crate::io;
|
||||
use alloc::string::{String, ToString};
|
||||
use alloc::string::String;
|
||||
#[cfg(feature = "raw_value")]
|
||||
use alloc::string::ToString;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Display};
|
||||
use core::num::FpCategory;
|
||||
@ -1057,7 +1059,7 @@ where
|
||||
}
|
||||
|
||||
fn serialize_char(self, value: char) -> Result<()> {
|
||||
self.ser.serialize_str(&value.to_string())
|
||||
self.ser.serialize_str(value.encode_utf8(&mut [0u8; 4]))
|
||||
}
|
||||
|
||||
fn serialize_bytes(self, _value: &[u8]) -> Result<()> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user