♻️ Rename `StringSink` to `SinkString`

main
pantonshire 3 years ago
parent 8309e19a68
commit ac26dc3422

@ -175,9 +175,9 @@ pub fn percent_encode_to_buf<B>(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))
}

@ -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<StringSink> for String {
impl AsRef<SinkString> 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<StringSink> for String {
impl AsMut<SinkString> 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]

Loading…
Cancel
Save