summaryrefslogtreecommitdiffstats
path: root/vendor/sysinfo/src/utils.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:21 +0000
commit4e8199b572f2035b7749cba276ece3a26630d23e (patch)
treef09feeed6a0fe39d027b1908aa63ea6b35e4b631 /vendor/sysinfo/src/utils.rs
parentAdding upstream version 1.66.0+dfsg1. (diff)
downloadrustc-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/utils.rs')
-rw-r--r--vendor/sysinfo/src/utils.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/vendor/sysinfo/src/utils.rs b/vendor/sysinfo/src/utils.rs
index 578ab61c6..70d96d9fa 100644
--- a/vendor/sysinfo/src/utils.rs
+++ b/vendor/sysinfo/src/utils.rs
@@ -1,19 +1,5 @@
// Take a look at the license at the top of the repository in the LICENSE file.
-/* convert a path to a NUL-terminated Vec<u8> suitable for use with C functions */
-#[cfg(all(
- not(feature = "unknown-ci"),
- any(target_os = "linux", target_os = "android", target_vendor = "apple")
-))]
-pub(crate) fn to_cpath(path: &std::path::Path) -> Vec<u8> {
- use std::{ffi::OsStr, os::unix::ffi::OsStrExt};
-
- let path_os: &OsStr = path.as_ref();
- let mut cpath = path_os.as_bytes().to_vec();
- cpath.push(0);
- cpath
-}
-
/// Converts the value into a parallel iterator (if the multithread feature is enabled)
/// Uses the rayon::iter::IntoParallelIterator trait
#[cfg(all(
@@ -27,7 +13,7 @@ pub(crate) fn to_cpath(path: &std::path::Path) -> Vec<u8> {
),
feature = "multithread"
),
- not(feature = "apple-sandbox"),
+ not(all(target_os = "macos", feature = "apple-sandbox")),
not(feature = "unknown-ci")
))]
pub(crate) fn into_iter<T>(val: T) -> T::Iter
@@ -51,7 +37,7 @@ where
not(feature = "multithread")
),
not(feature = "unknown-ci"),
- not(feature = "apple-sandbox")
+ not(all(target_os = "macos", feature = "apple-sandbox"))
))]
pub(crate) fn into_iter<T>(val: T) -> T::IntoIter
where