mirror of
https://github.com/aramperes/nut-rs.git
synced 2025-09-08 21:18:31 -04:00
Update dependencies; remove usage of flatten()
This commit is contained in:
parent
292cdecd87
commit
b79a6af150
4 changed files with 84 additions and 91 deletions
|
@ -53,8 +53,7 @@ fn main() -> nut_client::Result<()> {
|
|||
let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
|
||||
let port = env::var("NUT_PORT")
|
||||
.ok()
|
||||
.map(|s| s.parse::<u16>().ok())
|
||||
.flatten()
|
||||
.and_then(|s| s.parse::<u16>().ok())
|
||||
.unwrap_or(3493);
|
||||
|
||||
let username = env::var("NUT_USER").ok();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue