From ac26dc3422d6bb3871f52f7d5e3c7c57e2e70a7f Mon Sep 17 00:00:00 2001 From: pantonshire Date: Sat, 21 Jan 2023 18:52:55 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Rename=20`StringSink`=20to?= =?UTF-8?q?=20`SinkString`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/encoding/url.rs | 4 ++-- src/sink.rs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/encoding/url.rs b/src/encoding/url.rs index 74c9432..54a55a8 100644 --- a/src/encoding/url.rs +++ b/src/encoding/url.rs @@ -175,9 +175,9 @@ pub fn percent_encode_to_buf(buf: &mut String, bytes: &B) where B: AsRef<[u8]> + ?Sized, { - use crate::{convert::result_elim, sink::StringSink}; + use crate::{convert::result_elim, sink::SinkString}; - let sink = StringSink::from_string_mut(buf); + let sink = SinkString::from_string_mut(buf); result_elim(percent_encode_to(sink, bytes)) } diff --git a/src/sink.rs b/src/sink.rs index 30d5bbf..dc2f825 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -30,7 +30,7 @@ where } #[cfg(feature = "alloc")] -pub use string_sink::StringSink; +pub use string_sink::SinkString; #[cfg(feature = "alloc")] mod string_sink { @@ -43,9 +43,9 @@ mod string_sink { #[repr(transparent)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] - pub struct StringSink(pub String); + pub struct SinkString(pub String); - impl StringSink { + impl SinkString { #[inline] #[must_use] pub fn from_string_ref(s: &String) -> &Self { @@ -65,21 +65,21 @@ mod string_sink { } } - impl AsRef for String { + impl AsRef for String { #[inline] - fn as_ref(&self) -> &StringSink { - StringSink::from_string_ref(self) + fn as_ref(&self) -> &SinkString { + SinkString::from_string_ref(self) } } - impl AsMut for String { + impl AsMut for String { #[inline] - fn as_mut(&mut self) -> &mut StringSink { - StringSink::from_string_mut(self) + fn as_mut(&mut self) -> &mut SinkString { + SinkString::from_string_mut(self) } } - impl StrSink for StringSink { + impl StrSink for SinkString { type Error = Infallible; #[inline]