Skip to content

Commit 043d6ed

Browse files
DjDeveloperrclaude
andcommitted
fix(server): satisfy clippy manual_contains lint and rustfmt
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b5df136 commit 043d6ed

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎packages/server/src/auth.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn origin_is_allowed(config: &Config, origin: &str) -> bool {
236236
format!("http://[::1]:{}", config.http_port),
237237
];
238238
allowed.iter().any(|value| value == origin)
239-
|| LAUNCHPAD_ORIGINS.iter().any(|value| *value == origin)
239+
|| LAUNCHPAD_ORIGINS.contains(&origin)
240240
|| extra_allowed_origins().any(|value| value == "*" || value == origin)
241241
}
242242

‎packages/server/src/devtools.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,9 @@ fn proxied_target_port(target_id: &str) -> Result<u16, String> {
749749
fn metro_devtools_frontend_url(port: u16, entry: &Value, web_socket_debugger_url: &str) -> String {
750750
let frontend = string_value(entry, "devtoolsFrontendUrl");
751751
let asset_path = metro_frontend_asset_path(frontend.as_deref());
752-
let query = frontend.as_deref().and_then(|value| split_path_query(value).1);
752+
let query = frontend
753+
.as_deref()
754+
.and_then(|value| split_path_query(value).1);
753755
// Reverse-proxy Metro's own (version-matched) Fusebox frontend through the
754756
// SimDeck origin so the LAN client and Studio app can reach it, with the
755757
// socket rewritten to the proxied inspector path.
@@ -846,8 +848,9 @@ pub async fn fetch_metro_frontend_asset(
846848
.await
847849
.map_err(|_| format!("Timed out connecting to Metro at {address}."))?
848850
.map_err(|error| format!("Unable to connect to Metro at {address}: {error}"))?;
849-
let request =
850-
format!("GET {target} HTTP/1.1\r\nHost: {address}\r\nAccept: */*\r\nConnection: close\r\n\r\n");
851+
let request = format!(
852+
"GET {target} HTTP/1.1\r\nHost: {address}\r\nAccept: */*\r\nConnection: close\r\n\r\n"
853+
);
851854
timeout(METRO_ASSET_TIMEOUT, stream.write_all(request.as_bytes()))
852855
.await
853856
.map_err(|_| "Timed out requesting Metro asset.".to_owned())?
@@ -1773,9 +1776,7 @@ mod tests {
17731776
#[test]
17741777
fn upstream_websocket_origin_matches_metro_dev_server() {
17751778
assert_eq!(
1776-
upstream_websocket_origin(
1777-
"ws://127.0.0.1:8082/inspector/debug?device=abc&page=1"
1778-
),
1779+
upstream_websocket_origin("ws://127.0.0.1:8082/inspector/debug?device=abc&page=1"),
17791780
Some("http://127.0.0.1:8082".to_owned())
17801781
);
17811782
assert_eq!(

0 commit comments

Comments
 (0)