✨ sink: add SinkString::empty and SinkString::with_capacity
This commit is contained in:
1 parent
e1e26c7fd5
commit
266fa13165
1 file changed
+12
+12
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user