Use .as_str() instead of CowStr::Borrowed

This commit is contained in:
Joshua Nelson 2020-09-13 21:13:04 -04:00
parent f7983cae70
commit 6f2e1c6593

View File

@ -934,7 +934,7 @@ pub fn into_string(self) -> String {
if let Some(link) =
links.iter().find(|link| &*link.original_text == broken_link.reference)
{
Some((CowStr::Borrowed(&link.href), CowStr::Borrowed(&link.new_text)))
Some((link.href.as_str().into(), link.new_text.as_str().into()))
} else {
None
}
@ -1014,7 +1014,7 @@ pub fn into_string(self) -> String {
if let Some(link) =
links.iter().find(|link| &*link.original_text == broken_link.reference)
{
Some((CowStr::Borrowed(&link.href), CowStr::Borrowed(&link.new_text)))
Some((link.href.as_str().into(), link.new_text.as_str().into()))
} else {
None
}