Skip to content

Commit

Permalink
Merge pull request #2599 from dtolnay/encodeutf8
Browse files Browse the repository at this point in the history
Remove custom encode_utf8 implementation in favor of standard one
  • Loading branch information
dtolnay authored Aug 24, 2023
2 parents 7007c1b + f8d0b26 commit a741293
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 a741293

Please sign in to comment.