✨ sink: add SinkString::empty and SinkString::with_capacity

This commit is contained in:
pantonshire committed 2023-01-21 20:19:17 +00:00
1 parent e1e26c7fd5
commit 266fa13165
1 file changed
+12
+12
View File
@@ -68,6 +68,18 @@ mod string_sink {
pub struct SinkString(pub String);
impl SinkString {
#[inline]
#[must_use]
pub fn empty() -> Self {
Self(String::new())
}
#[inline]
#[must_use]
pub fn with_capacity(capacity: usize) -> Self {
Self(String::with_capacity(capacity))
}
#[inline]
#[must_use]
pub fn from_string_ref(s: &String) -> &Self {