提交 bc3395ef authored 作者: Serhij S's avatar Serhij S

clippy fmt

上级 5ddfcee8
......@@ -87,6 +87,7 @@ pub fn get_global_remote(url: &str) -> Option<Remote> {
}
#[derive(Deserialize)]
#[allow(clippy::module_name_repetitions)]
pub struct ServerConfig {
pub http: ServerHttpConfig,
pub aaa: ServerAaaConfig,
......@@ -101,11 +102,13 @@ impl ServerConfig {
}
#[derive(Deserialize)]
#[allow(clippy::module_name_repetitions)]
pub struct ServerHttpConfig {
pub bind: String,
}
#[derive(Deserialize)]
#[allow(clippy::module_name_repetitions)]
pub struct ServerAaaConfig {
pub management_key: Option<String>,
}
......@@ -9,7 +9,7 @@ use ureq::Agent;
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
pub fn display(url: &str, port: u16, agent: Agent) -> Result<(), Box<dyn std::error::Error>> {
let mut url = url::Url::parse(url)?;
url.set_port(Some(port)).map_err(|_| "invalid port")?;
url.set_port(Some(port)).map_err(|()| "invalid port")?;
let r = agent.get(url.as_str()).call()?;
if r.status() != 200 {
return Err(format!("Error: {}", r.status()).into());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论