mirror of
https://codeberg.org/icewind/nextcloud-config-parser.git
synced 2026-06-03 08:34:13 +02:00
fix formatting
This commit is contained in:
parent
172f328713
commit
f694ccb408
1 changed files with 9 additions and 5 deletions
14
src/nc.rs
14
src/nc.rs
|
|
@ -342,11 +342,15 @@ fn parse_redis_options(parsed: &Value, key: &str) -> RedisConfig {
|
|||
None
|
||||
};
|
||||
|
||||
let db = redis_options["dbindex"].clone().into_int().or_else(|| {
|
||||
redis_options["dbindex"]
|
||||
.as_str()
|
||||
.and_then(|i| i64::from_str(i).ok())
|
||||
}).unwrap_or(0);
|
||||
let db = redis_options["dbindex"]
|
||||
.clone()
|
||||
.into_int()
|
||||
.or_else(|| {
|
||||
redis_options["dbindex"]
|
||||
.as_str()
|
||||
.and_then(|i| i64::from_str(i).ok())
|
||||
})
|
||||
.unwrap_or(0);
|
||||
let password = redis_options["password"]
|
||||
.as_str()
|
||||
.filter(|pass| !pass.is_empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue