diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:21 +0000 |
commit | 4e8199b572f2035b7749cba276ece3a26630d23e (patch) | |
tree | f09feeed6a0fe39d027b1908aa63ea6b35e4b631 /vendor/sysinfo/src/freebsd/utils.rs | |
parent | Adding upstream version 1.66.0+dfsg1. (diff) | |
download | rustc-4e8199b572f2035b7749cba276ece3a26630d23e.tar.xz rustc-4e8199b572f2035b7749cba276ece3a26630d23e.zip |
Adding upstream version 1.67.1+dfsg1.upstream/1.67.1+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/sysinfo/src/freebsd/utils.rs')
-rw-r--r-- | vendor/sysinfo/src/freebsd/utils.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/sysinfo/src/freebsd/utils.rs b/vendor/sysinfo/src/freebsd/utils.rs index 00de3e9d9..5745a37f6 100644 --- a/vendor/sysinfo/src/freebsd/utils.rs +++ b/vendor/sysinfo/src/freebsd/utils.rs @@ -169,7 +169,7 @@ pub(crate) fn get_sys_value_str_by_name(name: &[u8]) -> Option<String> { && size > 0 { // now create a buffer with the size and get the real value - let mut buf: Vec<libc::c_char> = vec![0; size as usize]; + let mut buf: Vec<libc::c_char> = vec![0; size as _]; if libc::sysctlbyname( name.as_ptr() as *const c_char, @@ -210,7 +210,7 @@ pub(crate) fn get_system_info(mib: &[c_int], default: Option<&str>) -> Option<St default.map(|s| s.to_owned()) } else { // set the buffer to the correct size - let mut buf: Vec<libc::c_char> = vec![0; size as usize]; + let mut buf: Vec<libc::c_char> = vec![0; size as _]; if libc::sysctl( mib.as_ptr(), @@ -287,7 +287,7 @@ pub(crate) unsafe fn get_frequency_for_cpu(cpu_nb: c_int) -> u64 { // The information can be missing if it's running inside a VM. if !get_sys_value_by_name( - format!("dev.cpu.{}.freq\0", cpu_nb).as_bytes(), + format!("dev.cpu.{cpu_nb}.freq\0").as_bytes(), &mut frequency, ) { frequency = 0; |