Fix unused compilation warning on windows
@@ -1894,14 +1894,16 @@ fn get_fd_count() -> std::io::Result<usize> {
}
}
+#[cfg(unix)]
+fn get_fd_count() -> std::io::Result<usize> {
// Assume we have /proc/self/fd unless we know we don't
#[cfg(not(any(target_os = "freebsd", target_os = "macos", target_os = "ios")))]
const FD_DIR: &str = "/proc/self/fd";
#[cfg(any(target_os = "freebsd", target_os = "macos", target_os = "ios"))]
const FD_DIR: &str = "/dev/fd";
-#[cfg(unix)]
-fn get_fd_count() -> std::io::Result<usize> { Ok(fs::read_dir(FD_DIR)?.count()) }
+ Ok(fs::read_dir(FD_DIR)?.count())
+}
#[cfg(unix)]
fn track_memory_stats() {
