We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b806c39 commit 336a12eCopy full SHA for 336a12e
src/cow_rc_str.rs
@@ -96,25 +96,6 @@ impl<'a> CowRcStr<'a> {
96
}
97
98
99
-
100
- /// Convert into `String`, re-using an existing memory allocation if possible.
101
- #[inline]
102
- pub fn into_owned(self) -> String {
103
- let unpacked = self.unpack();
104
105
- // Inhibit destructor: we’re taking ownership of this strong reference (if any)
106
- mem::forget(self);
107
108
- match unpacked {
109
- Ok(s) => s.to_owned(),
110
- Err(ptr) => {
111
- let rc = unsafe {
112
- Rc::from_raw(ptr)
113
- };
114
- Rc::try_unwrap(rc).unwrap_or_else(|rc| (*rc).clone())
115
- }
116
117
118
119
120
impl<'a> Clone for CowRcStr<'a> {
0 commit comments