Update dependencies

This commit is contained in:
David Peter 2024-11-10 22:37:04 +01:00 committed by David Peter
parent 83f04cdd31
commit 2efc633486
5 changed files with 268 additions and 328 deletions

557
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ repository = "https://github.com/sharkdp/hyperfine"
version = "1.18.0"
edition = "2018"
build = "build.rs"
rust-version = "1.70.0"
rust-version = "1.76.0"
[features]
# Use the nightly feature windows_process_extensions_main_thread_handle
@ -20,20 +20,20 @@ windows_process_extensions_main_thread_handle = []
colored = "2.1"
indicatif = "=0.17.4"
statistical = "1.0"
csv = "1.1"
csv = "1.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rust_decimal = "1.35"
rust_decimal = "1.36"
rand = "0.8"
shell-words = "1.0"
thiserror = "1.0"
thiserror = "2.0"
anyhow = "1.0"
[target.'cfg(not(windows))'.dependencies]
libc = "0.2"
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.48", features = [
windows-sys = { version = "0.59", features = [
"Win32_Foundation",
"Win32_Security",
"Win32_System_JobObjects",
@ -45,18 +45,26 @@ windows-sys = { version = "0.48", features = [
once_cell = "1.19"
[target.'cfg(target_os="linux")'.dependencies]
nix = { version = "0.27.1", features = ["zerocopy"] }
nix = { version = "0.29", features = ["zerocopy"] }
[dependencies.clap]
version = "4"
default-features = false
features = ["suggestions", "color", "wrap_help", "cargo", "help", "usage", "error-context"]
features = [
"suggestions",
"color",
"wrap_help",
"cargo",
"help",
"usage",
"error-context",
]
[dev-dependencies]
approx = "0.5"
assert_cmd = "2.0"
predicates = "3.0"
tempfile = "3.9"
tempfile = "3.14"
[build-dependencies]
clap = "4.4.12"

View File

@ -316,7 +316,7 @@ Hyperfine can be installed from source via [cargo](https://doc.rust-lang.org/car
cargo install --locked hyperfine
```
Make sure that you use Rust 1.70 or newer.
Make sure that you use Rust 1.76 or newer.
### From binaries (Linux, macOS, Windows)

View File

@ -11,7 +11,7 @@ use nix::fcntl::{splice, SpliceFFlags};
#[cfg(target_os = "linux")]
use std::fs::File;
#[cfg(target_os = "linux")]
use std::os::unix::io::AsRawFd;
use std::os::fd::AsFd;
#[cfg(target_os = "windows")]
use windows_sys::Win32::System::Threading::CREATE_SUSPENDED;
@ -53,9 +53,9 @@ fn discard(output: ChildStdout) {
{
if let Ok(file) = File::create("/dev/null") {
while let Ok(bytes) = splice(
output.as_raw_fd(),
output.as_fd(),
None,
file.as_raw_fd(),
file.as_fd(),
None,
CHUNK_SIZE,
SpliceFFlags::empty(),

View File

@ -37,7 +37,7 @@ static NtResumeProcess: Lazy<unsafe extern "system" fn(ProcessHandle: HANDLE) ->
Lazy::new(|| {
// SAFETY: Getting the module handle for ntdll.dll is safe
let ntdll = unsafe { GetModuleHandleW(w!("ntdll.dll")) };
assert!(ntdll != 0, "GetModuleHandleW failed");
assert!(ntdll != std::ptr::null_mut(), "GetModuleHandleW failed");
// SAFETY: The ntdll handle is valid
let nt_resume_process = unsafe { GetProcAddress(ntdll, s!("NtResumeProcess")) };
@ -56,7 +56,10 @@ impl CPUTimer {
// SAFETY: Creating a new job object is safe
let job_object = unsafe { CreateJobObjectW(ptr::null_mut(), ptr::null_mut()) };
assert!(job_object != 0, "CreateJobObjectW failed");
assert!(
job_object != std::ptr::null_mut(),
"CreateJobObjectW failed"
);
// SAFETY: The job object handle is valid
let ret = unsafe { AssignProcessToJobObject(job_object, child_handle) };