From 56f224c0435cc74ea53ae6d2f12b778528781269 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 19 Feb 2020 15:51:46 +0000 Subject: [PATCH] restore get_logical_cores Signed-off-by: Nick Cameron --- src/sysinfo.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/sysinfo.rs b/src/sysinfo.rs index 5dfa5857a..e9b16e52e 100644 --- a/src/sysinfo.rs +++ b/src/sysinfo.rs @@ -87,11 +87,8 @@ pub extern crate pnet_datalink as datalink; pub use common::{AsU32, DiskType, NetworksIter, Pid, RefreshKind}; pub use io::IOLoad; pub use net::NICLoad; -pub use num_cpus::get_physical as get_physical_cores; -pub use sys::{ - Component, Disk, NetworkData, Networks, Process, - ProcessStatus, Processor, System, -}; +pub use num_cpus::{get as get_logical_cores, get_physical as get_physical_cores}; +pub use sys::{Component, Disk, NetworkData, Networks, Process, ProcessStatus, Processor, System}; pub use traits::{ ComponentExt, DiskExt, NetworkExt, NetworksExt, ProcessExt, ProcessorExt, SystemExt, }; @@ -290,6 +287,11 @@ mod test { println!("test test_io_load: {:?}", ::IOLoad::snapshot()); } + #[test] + fn test_get_logical_cores() { + assert_ne!(::get_logical_cores(), 0, "expect none-zero logical core"); + } + #[test] fn test_get_cores() { assert_ne!(::get_physical_cores(), 0, "expect none-zero physical core");