mirror of
https://github.com/itsKaynine/electron-injector.git
synced 2026-04-03 09:46:32 +02:00
fix: linting issues from clippy
This commit is contained in:
@@ -94,8 +94,7 @@ impl Injector {
|
||||
// Inject prelude
|
||||
if self.config.prelude {
|
||||
info!("Injecting prelude script (id: {})", page.id);
|
||||
_ = self
|
||||
.evaluate(&mut ws, &prelude_script)
|
||||
self.evaluate(&mut ws, &prelude_script)
|
||||
.expect("Should be able to evaluate JS");
|
||||
}
|
||||
|
||||
@@ -103,8 +102,7 @@ impl Injector {
|
||||
for user_script in user_scripts.iter() {
|
||||
// Inject using evaluate
|
||||
info!("Injecting script: {}", user_script.file_path);
|
||||
_ = self
|
||||
.evaluate(&mut ws, &user_script.content)
|
||||
self.evaluate(&mut ws, &user_script.content)
|
||||
.expect("Should be able to evaluate JS");
|
||||
}
|
||||
|
||||
@@ -176,13 +174,13 @@ impl Injector {
|
||||
})
|
||||
.collect();
|
||||
|
||||
return scripts;
|
||||
scripts
|
||||
}
|
||||
|
||||
fn spawn_process(&self) -> Result<Child> {
|
||||
// Prepare args
|
||||
let mut args = vec![format!("--remote-debugging-port={}", &self.port)];
|
||||
args.extend(self.config.arg.iter().map(|a| a.clone()));
|
||||
args.extend(self.config.arg.iter().cloned());
|
||||
|
||||
// Spawn child process
|
||||
debug!(
|
||||
@@ -258,7 +256,7 @@ impl Injector {
|
||||
debug!("[Runtime.evaluate] Parsed response: {:#?}", response);
|
||||
|
||||
// Handle exception
|
||||
if let Some(_) = response.result.exception_details {
|
||||
if response.result.exception_details.is_some() {
|
||||
warn!(
|
||||
"[Runtime.evaluate] Caught exception while evaluating script: {:#?}",
|
||||
response
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct WebSocket {
|
||||
|
||||
impl WebSocket {
|
||||
pub fn connect(address: &str) -> Result<Self, tungstenite::Error> {
|
||||
let url = url::Url::parse(&address).expect("Should be a valid address");
|
||||
let url = url::Url::parse(address).expect("Should be a valid address");
|
||||
|
||||
let (socket, response) = tungstenite::connect(url)?;
|
||||
info!("WebSocket connected (status: {})", response.status());
|
||||
|
||||
Reference in New Issue
Block a user