Skip to content

Commit

Permalink
chore: clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
fgardt committed Aug 12, 2024
1 parent a330654 commit ba08ca4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/windows.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//! A small windows application to inject the Rivets DLL into Factorio.

use crate::common;
use anyhow::{anyhow, bail, Context, Result};
use anyhow::{anyhow, bail, Result};
use dll_syringe::process::{BorrowedProcess, ProcessModule};
use dll_syringe::{process::OwnedProcess, Syringe};
use std::ffi::CString;
use std::fs;
use std::fs::File;
use std::io;
use std::os::windows::io::FromRawHandle;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -50,7 +48,7 @@ fn rpc(
let rpc = unsafe {
syringe.get_payload_procedure::<fn(PathBuf, PathBuf) -> Option<String>>(module, "main")
}?
.ok_or(anyhow!("Failed to get RPC procedure"))?;
.ok_or_else(|| anyhow!("Failed to get RPC procedure"))?;
match rpc.call(
&read_path.as_ref().to_path_buf(),
&write_path.as_ref().to_path_buf(),
Expand All @@ -60,6 +58,7 @@ fn rpc(
}
}

#[allow(clippy::cast_possible_truncation)]
fn create_pipe() -> Result<(HANDLE, HANDLE)> {
let mut stdout_read = INVALID_HANDLE_VALUE;
let mut stdout_write = INVALID_HANDLE_VALUE;
Expand Down

0 comments on commit ba08ca4

Please sign in to comment.