diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7ef1dd7c..c6d15906 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [ubuntu-22.04, ubuntu-24.04] rust_toolchain: [stable, beta] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f527046b..1e1c9246 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-14] + os: [macos-14, macos-15, macos-26] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1770f37..eb7ea25b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, windows-2022] + os: [windows-2022, windows-2025] env: - TARGET: x86_64-pc-windows-msvc - TARGET: i686-pc-windows-msvc diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index c4425ee3..9ee862fe 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -109,6 +109,7 @@ fn main() { }; println!("cargo:rustc-link-lib=static={lib_prefix}ssl"); println!("cargo:rustc-link-lib=static={lib_prefix}crypto"); + println!("cargo:rustc-link-lib=advapi32"); } else { cfg.define("LIBSSH2_WINCNG", None); } diff --git a/src/channel.rs b/src/channel.rs index d695586d..ccd2912a 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -65,7 +65,7 @@ impl Channel { } } - fn lock(&self) -> LockedChannel { + fn lock(&self) -> LockedChannel<'_> { let sess = self.channel_inner.sess.lock(); LockedChannel { sess, @@ -519,7 +519,7 @@ impl Drop for ChannelInner { } impl Stream { - fn lock(&self) -> LockedStream { + fn lock(&self) -> LockedStream<'_> { let sess = self.channel_inner.sess.lock(); LockedStream { sess, diff --git a/src/session.rs b/src/session.rs index 6775c9ec..70325a0d 100644 --- a/src/session.rs +++ b/src/session.rs @@ -175,7 +175,7 @@ impl Session { } #[doc(hidden)] - pub fn raw(&self) -> MappedMutexGuard { + pub fn raw(&self) -> MappedMutexGuard<'_, raw::LIBSSH2_SESSION> { let inner = self.inner(); MutexGuard::map(inner, |inner| unsafe { &mut *inner.raw }) } @@ -1113,7 +1113,7 @@ impl Session { } } - fn inner(&self) -> MutexGuard { + fn inner(&self) -> MutexGuard<'_, SessionInner> { self.inner.lock() } diff --git a/src/sftp.rs b/src/sftp.rs index 6299cbdf..31184f45 100644 --- a/src/sftp.rs +++ b/src/sftp.rs @@ -435,7 +435,7 @@ impl Sftp { }) } - fn lock(&self) -> Result { + fn lock(&self) -> Result, Error> { match self.inner.as_ref() { Some(sftp_inner_drop_wrapper) => { let sftp_inner = sftp_inner_drop_wrapper @@ -658,7 +658,7 @@ impl File { self.rc(&locked, unsafe { raw::libssh2_sftp_fsync(locked.raw) }) } - fn lock(&self) -> Result { + fn lock(&self) -> Result, Error> { match self.inner.as_ref() { Some(file_inner) => { let sftp_inner = file_inner.sftp.0.as_ref().expect( diff --git a/src/util.rs b/src/util.rs index 258aa59c..2a0adc62 100644 --- a/src/util.rs +++ b/src/util.rs @@ -4,14 +4,14 @@ use std::path::Path; use {raw, Error, ErrorCode}; #[cfg(unix)] -pub fn path2bytes(p: &Path) -> Result, Error> { +pub fn path2bytes(p: &Path) -> Result, Error> { use std::ffi::OsStr; use std::os::unix::prelude::*; let s: &OsStr = p.as_ref(); check(Cow::Borrowed(s.as_bytes())) } #[cfg(windows)] -pub fn path2bytes(p: &Path) -> Result, Error> { +pub fn path2bytes(p: &Path) -> Result, Error> { p.to_str() .map(|s| s.as_bytes()) .ok_or_else(|| {