Replace StrAllocating.into_owned() with .into_string()
We already have into_string(), but it was implemented in terms of into_owned(). Flip it around and deprecate into_owned(). Remove a few spurious calls to .into_owned() that existed in libregex and librustdoc.
This commit is contained in:
@@ -573,13 +573,13 @@ impl<'t> Replacer for NoExpand<'t> {
|
||||
|
||||
impl<'t> Replacer for &'t str {
|
||||
fn reg_replace<'a>(&'a mut self, caps: &Captures) -> MaybeOwned<'a> {
|
||||
Owned(caps.expand(*self).into_owned())
|
||||
Owned(caps.expand(*self))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Replacer for |&Captures|: 'a -> String {
|
||||
fn reg_replace<'r>(&'r mut self, caps: &Captures) -> MaybeOwned<'r> {
|
||||
Owned((*self)(caps).into_owned())
|
||||
Owned((*self)(caps))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user