Because I want to obtain audio from other sources, I want to add a web_site parameter.
Just like this:
impl<'a> QueryType<'a> {
fn as_cow_str(&'a self,web_site:&str, n_results: usize) -> Cow<'a, str> {
match self {
Self::Url(Cow::Owned(u)) => Cow::Borrowed(u),
Self::Url(Cow::Borrowed(u)) => Cow::Borrowed(u),
Self::Search(s) => Cow::Owned(format!("{web_site}:{n_results}:{s}")),
}
}
}
This is the original method
impl<'a> QueryType<'a> {
fn as_cow_str(&'a self, n_results: usize) -> Cow<'a, str> {
match self {
Self::Url(Cow::Owned(u)) => Cow::Borrowed(u),
Self::Url(Cow::Borrowed(u)) => Cow::Borrowed(u),
Self::Search(s) => Cow::Owned(format!("ytsearch{n_results}:{s}")),
}
}
}
I'm not very good at English, so I'm using a translator to write this issue, hoping to express my meaning.