build(deps): bump the deps group across 1 directory with 2 updates (#1859)

* build(deps): bump the deps group across 1 directory with 2 updates

Bumps the deps group with 2 updates in the / directory: [fs4](https://github.com/al8n/fs4-rs) and [windows-sys](https://github.com/microsoft/windows-rs).


Updates `fs4` from 0.8.4 to 0.9.1
- [Release notes](https://github.com/al8n/fs4-rs/releases)
- [Commits](https://github.com/al8n/fs4-rs/commits)

Updates `windows-sys` from 0.52.0 to 0.59.0
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.52.0...0.59.0)

---
updated-dependencies:
- dependency-name: fs4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: deps
- dependency-name: windows-sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix use of fs4

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Fix windows.rs

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Rm drop impl for LibraryHandle

As unmounting dynlib might cause UB

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Fix clippy in windows.rs

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2024-08-03 15:03:10 +10:00 committed by GitHub
parent 5d57d4506e
commit cdbb121112
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 14 deletions

6
Cargo.lock generated
View file

@ -898,7 +898,7 @@ dependencies = [
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber", "tracing-subscriber",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@ -1123,9 +1123,9 @@ dependencies = [
[[package]] [[package]]
name = "fs4" name = "fs4"
version = "0.8.4" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de"
dependencies = [ dependencies = [
"rustix", "rustix",
"windows-sys 0.52.0", "windows-sys 0.52.0",

View file

@ -27,7 +27,7 @@ tracing = ["dep:tracing"]
cli-logging = ["tracing", "dep:tracing-subscriber"] cli-logging = ["tracing", "dep:tracing-subscriber"]
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.52.0", features = [ windows-sys = { version = "0.59.0", features = [
"Win32_System_Threading", "Win32_System_Threading",
"Win32_System_SystemInformation", "Win32_System_SystemInformation",
"Win32_Foundation", "Win32_Foundation",

View file

@ -1,6 +1,6 @@
use std::mem; use std::mem;
use windows_sys::Win32::{ use windows_sys::Win32::{
Foundation::{FreeLibrary, HMODULE, S_OK}, Foundation::{HMODULE, S_OK},
System::{ System::{
LibraryLoader::{GetProcAddress, LoadLibraryA}, LibraryLoader::{GetProcAddress, LoadLibraryA},
SystemInformation::{ SystemInformation::{
@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE);
impl LibraryHandle { impl LibraryHandle {
fn new(name: &[u8]) -> Option<Self> { fn new(name: &[u8]) -> Option<Self> {
let handle = unsafe { LoadLibraryA(name.as_ptr() as _) }; let handle = unsafe { LoadLibraryA(name.as_ptr() as _) };
(handle != 0).then(|| Self(handle)) (!handle.is_null()).then_some(Self(handle))
} }
/// Get a function pointer to a function in the library. /// Get a function pointer to a function in the library.
@ -33,12 +33,6 @@ impl LibraryHandle {
} }
} }
impl Drop for LibraryHandle {
fn drop(&mut self) {
unsafe { FreeLibrary(self.0) };
}
}
type GetMachineTypeAttributesFuncType = type GetMachineTypeAttributesFuncType =
unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32; unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32;
const _: () = { const _: () = {

View file

@ -10,4 +10,4 @@ edition = "2021"
license = "Apache-2.0 OR MIT" license = "Apache-2.0 OR MIT"
[dependencies] [dependencies]
fs4 = "0.8.1" fs4 = "0.9.1"

View file

@ -8,7 +8,7 @@ use std::{
ops, ops,
}; };
use fs4::FileExt; use fs4::fs_std::FileExt;
/// A locked file. /// A locked file.
#[derive(Debug)] #[derive(Debug)]