refactor(api): drop dead-code cookie loop in detect_cookie_file

The second loop is unreachable: the first loop returns as soon as it
finds an existing candidate. Collapse to a single iterator chain.
This commit is contained in:
LORDBABUINO
2026-05-11 20:17:58 -03:00
parent 9e1cadcc5e
commit 3ab2fb3c9c
-5
View File
@@ -139,11 +139,6 @@ fn detect_cookie_file(url: &str) -> Option<PathBuf> {
.map(|(_, port)| port)
.unwrap_or(8332);
for candidate in cookie_candidates(&bitcoin_dir, port) {
if candidate.exists() {
return Some(candidate);
}
}
cookie_candidates(&bitcoin_dir, port)
.into_iter()
.find(|candidate| candidate.exists())