Skip to content

Commit

Permalink
Merge pull request #4408 from gitbutlerapp/upgrade-windows-crate
Browse files Browse the repository at this point in the history
upgrade version of the windows crate
  • Loading branch information
krlvi authored Jul 16, 2024
2 parents 8b96b2e + cc8d7c9 commit 9e0a072
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 51 deletions.
105 changes: 58 additions & 47 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/gitbutler-git/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ gix-path = "0.10.7"
nix = { version = "0.29.0", features = ["process", "socket", "user"] }

[target."cfg(windows)".dependencies]
windows = { version = "0.57.0", features = [
windows = { version = "0.58.0", features = [
"Win32",
"Win32_System",
"Win32_System_Pipes",
Expand Down
2 changes: 1 addition & 1 deletion crates/gitbutler-git/src/bin/askpass/windows-pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl IntoRawHandle for Pipe {

impl FromRawHandle for Pipe {
unsafe fn from_raw_handle(handle: RawHandle) -> Self {
let handle = HANDLE(handle as isize);
let handle = HANDLE(handle);
Pipe {
handle: Handle { inner: handle },
}
Expand Down
4 changes: 2 additions & 2 deletions crates/gitbutler-git/src/executor/tokio/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Socket for BufStream<NamedPipeServer> {

fn pid(&self) -> Result<Pid, Self::Error> {
let raw_handle = self.get_ref().as_raw_handle();
let handle: HANDLE = HANDLE(raw_handle as isize);
let handle: HANDLE = HANDLE(raw_handle);
let mut out_pid: u32 = 0;

#[allow(unsafe_code)]
Expand All @@ -35,7 +35,7 @@ impl Socket for BufStream<NamedPipeServer> {
async fn read_line(&mut self) -> Result<String, Self::Error> {
let mut buf = String::new();
<Self as AsyncBufReadExt>::read_line(self, &mut buf).await?;
Ok(buf.trim_end_matches(|c| c == '\r' || c == '\n').into())
Ok(buf.trim_end_matches(['\r', '\n']).into())
}

async fn write_line(&mut self, line: &str) -> Result<(), Self::Error> {
Expand Down

0 comments on commit 9e0a072

Please sign in to comment.