mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-19 06:12:24 +02:00
clippy fixes
This commit is contained in:
@@ -199,7 +199,7 @@ async fn xtream_player_api_stream(
|
||||
}
|
||||
|
||||
let extension = stream_ext.unwrap_or_else(
|
||||
|| extract_extension_from_url(&pli.url).map_or_else(String::new, |ext| ext.to_string()));
|
||||
|| extract_extension_from_url(&pli.url).map_or_else(String::new, std::string::ToString::to_string));
|
||||
|
||||
let query_path = if stream_req.action_path.is_empty() {
|
||||
format!("{}{extension}", pli.provider_id)
|
||||
|
||||
@@ -400,7 +400,7 @@ fn get_strm_url(credentials_and_server_info: Option<&(ProxyUserCredentials, ApiP
|
||||
_ => None,
|
||||
} {
|
||||
let url = str_item_info.url.as_str();
|
||||
let ext = extract_extension_from_url(url).map_or_else(String::new, |ext| ext.to_string());
|
||||
let ext = extract_extension_from_url(url).map_or_else(String::new, std::string::ToString::to_string);
|
||||
format!("{}/{stream_type}/{}/{}/{}{ext}",
|
||||
server_info.get_base_url(),
|
||||
user.username,
|
||||
|
||||
@@ -370,11 +370,9 @@ pub fn extract_extension_from_url(url: &str) -> Option<&str> {
|
||||
return Some(&path[last_dot_pos..]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let Some(last_dot_pos) = url.rfind('.') {
|
||||
if last_dot_pos > url.rfind('/').unwrap_or(0) {
|
||||
return Some(&url[last_dot_pos..]);
|
||||
}
|
||||
} else if let Some(last_dot_pos) = url.rfind('.') {
|
||||
if last_dot_pos > url.rfind('/').unwrap_or(0) {
|
||||
return Some(&url[last_dot_pos..]);
|
||||
}
|
||||
}
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user