refactor: use generic string arguments

This commit is contained in:
ThetaDev 2022-11-30 13:17:28 +01:00
parent 94b55711cb
commit 8097873fe1
12 changed files with 111 additions and 60 deletions

View file

@ -20,8 +20,12 @@ struct QResolveUrl<'a> {
}
impl RustyPipeQuery {
pub async fn resolve_url(self, url: &str, resolve_albums: bool) -> Result<UrlTarget, Error> {
let (url, params) = util::url_to_params(url)?;
pub async fn resolve_url<S: AsRef<str>>(
self,
url: S,
resolve_albums: bool,
) -> Result<UrlTarget, Error> {
let (url, params) = util::url_to_params(url.as_ref())?;
let mut is_shortlink = url.domain().and_then(|d| match d {
"youtu.be" => Some(true),