Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 20, 2024
1 parent 7359d55 commit 8c9278b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,18 @@ impl BrowserIpc {
};
let cmd = CDPCommand::new("Runtime.evaluate", params, Some(self.session_id.clone()));
let result = cdp.send(cmd, None)?;
let res_type = result["result"]["result"]["type"].as_str().unwrap_or_default();
let res_type = result["result"]["result"]["type"]
.as_str()
.unwrap_or_default();

if ["string", "number", "boolean", "bigint", "symbol"].contains(&res_type) {
return match result["result"]["result"].get("value") {
Some(val) => Ok(val.clone()),
None => {
Err(CrowserError::CDPError(format!(
"Eval: No result found in object: {:?}",
result
)))
}
}
None => Err(CrowserError::CDPError(format!(
"Eval: No result found in object: {:?}",
result
))),
};
}

Ok(Value::Null)
Expand Down

0 comments on commit 8c9278b

Please sign in to comment.