mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2026-02-04 17:37:54 +00:00
Applied clippy fixes
This commit is contained in:
@@ -7,25 +7,19 @@ pub struct InboundGenerationOptions {
|
||||
|
||||
pub fn generate_inbound_config(options: InboundGenerationOptions) -> Vec<config_models::Inbound> {
|
||||
let mut inbounds: Vec<config_models::Inbound> = vec![];
|
||||
match options.socks_port {
|
||||
Some(port) => {
|
||||
inbounds.push(generate_socks_inbound(port));
|
||||
}
|
||||
None => {}
|
||||
if let Some(port) = options.socks_port {
|
||||
inbounds.push(generate_socks_inbound(port));
|
||||
}
|
||||
|
||||
match options.http_port {
|
||||
Some(port) => {
|
||||
inbounds.push(generate_http_inbound(port));
|
||||
}
|
||||
None => {}
|
||||
if let Some(port) = options.http_port {
|
||||
inbounds.push(generate_http_inbound(port));
|
||||
}
|
||||
|
||||
return inbounds;
|
||||
inbounds
|
||||
}
|
||||
|
||||
pub fn generate_http_inbound(http_port: u16) -> config_models::Inbound {
|
||||
return config_models::Inbound {
|
||||
config_models::Inbound {
|
||||
protocol: String::from("http"),
|
||||
port: http_port,
|
||||
tag: String::from("http-in"),
|
||||
@@ -42,11 +36,11 @@ pub fn generate_http_inbound(http_port: u16) -> config_models::Inbound {
|
||||
String::from("quic"),
|
||||
]),
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn generate_socks_inbound(socks_port: u16) -> config_models::Inbound {
|
||||
return config_models::Inbound {
|
||||
config_models::Inbound {
|
||||
protocol: String::from("socks"),
|
||||
port: socks_port,
|
||||
tag: String::from("socks-in"),
|
||||
@@ -63,5 +57,5 @@ pub fn generate_socks_inbound(socks_port: u16) -> config_models::Inbound {
|
||||
String::from("quic"),
|
||||
]),
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user