diff --git a/src/proxy/mod.rs b/src/proxy/mod.rs index 82c5cbd..7e19f06 100644 --- a/src/proxy/mod.rs +++ b/src/proxy/mod.rs @@ -65,6 +65,7 @@ impl UserPassAuthCredential { } } +#[allow(clippy::mutable_key_type)] #[derive(Debug, Serialize)] pub struct ProxyServer { pub addr: SocketAddr, diff --git a/src/web/rich.rs b/src/web/rich.rs index e0b8e8d..57b7249 100644 --- a/src/web/rich.rs +++ b/src/web/rich.rs @@ -27,7 +27,7 @@ impl ResourceBundle { file.read_to_end(&mut content) .expect("error on read moproxy-web bundle"); - let name_ext = name.rsplitn(2, '.').next(); + let name_ext = name.rsplit_once('.').map(|x| x.1); let mime = match name_ext { Some("html") => "text/html", Some("js") => "application/javascript",