mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-23 22:48:21 -05:00
Update src/config/parser.rs
Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
This commit is contained in:
parent
c07d9280be
commit
6464827834
@ -123,14 +123,12 @@ impl Config {
|
|||||||
_ => parsed_cet,
|
_ => parsed_cet,
|
||||||
};
|
};
|
||||||
|
|
||||||
let proxy_str = globals.get::<_, String>("proxy")?;
|
let proxy_opt = globals.get::<_, Option<String>>("proxy")?;
|
||||||
let proxy = match Proxy::all(proxy_str) {
|
let proxy = proxy_opt.and_then(|proxy_str| {
|
||||||
Ok(proxy) => Some(proxy),
|
Proxy::all(proxy_str).ok().and_then(|_| {
|
||||||
Err(_) => {
|
|
||||||
log::error!("Invalid proxy url, defaulting to no proxy.");
|
log::error!("Invalid proxy url, defaulting to no proxy.");
|
||||||
None
|
None
|
||||||
}
|
})
|
||||||
};
|
|
||||||
|
|
||||||
Ok(Config {
|
Ok(Config {
|
||||||
port: globals.get::<_, u16>("port")?,
|
port: globals.get::<_, u16>("port")?,
|
||||||
|
Loading…
Reference in New Issue
Block a user