Skip to content

Commit

Permalink
Remove custom encode_utf8 implementation in favor of standard one
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 24, 2023
1 parent 7007c1b commit f8d0b26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
3 changes: 1 addition & 2 deletions serde/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ mod format;
mod ignored_any;
mod impls;
pub(crate) mod size_hint;
mod utf8;

pub use self::ignored_any::IgnoredAny;

Expand Down Expand Up @@ -1478,7 +1477,7 @@ pub trait Visitor<'de>: Sized {
where
E: Error,
{
self.visit_str(utf8::encode(v).as_str())
self.visit_str(v.encode_utf8(&mut [0u8; 4]))
}

/// The input contains a string. The lifetime of the string is ephemeral and
Expand Down
46 changes: 0 additions & 46 deletions serde/src/de/utf8.rs

This file was deleted.

0 comments on commit f8d0b26

Please sign in to comment.