Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions phantom-core/src/dom/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,8 @@ impl<'a> selectors::Element for DomElement<'a> {
arena: self.arena,
});
}
match node.previous_sibling() {
Some(prev) => curr = prev,
None => return None,
}
let prev = node.previous_sibling()?;
curr = prev;
}
}

Expand All @@ -193,10 +191,8 @@ impl<'a> selectors::Element for DomElement<'a> {
arena: self.arena,
});
}
match node.next_sibling() {
Some(next) => curr = next,
None => return None,
}
let next = node.next_sibling()?;
curr = next;
}
}

Expand Down
7 changes: 3 additions & 4 deletions phantom-mcp/src/bin/phantom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ async fn run_http() -> Result<(), Box<dyn std::error::Error>> {
telemetry::init();

let bind_addr = env::var("PHANTOM_BIND_ADDR").unwrap_or_else(|_| "0.0.0.0:8080".to_string());
let api_key =
env::var("PHANTOM_API_KEY")
.ok()
.and_then(|v| if v.trim().is_empty() { None } else { Some(v) });
let api_key = env::var("PHANTOM_API_KEY")
.ok()
.filter(|v| !v.trim().is_empty());

let rate_limit = env::var("PHANTOM_RATE_LIMIT")
.ok()
Expand Down
Loading