aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/config.rs')
-rw-r--r--crates/shirabe/src/config.rs21
1 files changed, 3 insertions, 18 deletions
diff --git a/crates/shirabe/src/config.rs b/crates/shirabe/src/config.rs
index 966d6bac..8f78ecca 100644
--- a/crates/shirabe/src/config.rs
+++ b/crates/shirabe/src/config.rs
@@ -841,29 +841,14 @@ impl Config {
.and_then(|v| v.as_bool())
.unwrap_or(false);
if secure_http {
- let map: IndexMap<String, String> = protos
- .iter()
- .enumerate()
- .map(|(i, s)| (i.to_string(), s.clone()))
- .collect();
let found = array_search_mixed(
&PhpMixed::String("git".to_string()),
- &PhpMixed::Array(
- map.into_iter()
- .map(|(k, v)| (k, PhpMixed::String(v)))
- .collect(),
- ),
+ &PhpMixed::List(protos.iter().cloned().map(PhpMixed::String).collect()),
false,
);
if let Some(idx_val) = found {
- let idx = idx_val
- .as_string()
- .unwrap_or("")
- .parse::<usize>()
- .unwrap_or(usize::MAX);
- if idx < protos.len() {
- protos.remove(idx);
- }
+ let idx = idx_val.as_int().expect("list search index") as usize;
+ protos.remove(idx);
}
}
let first = protos.first().cloned();