Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove new_all methods #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ use sysinfo::{
Components, Disks, Networks, System,
};

// Please note that we use "new_all" to ensure that all lists of
// CPUs and processes are filled!
let mut sys = System::new_all();
let mut sys = System::new();

// First we update all information of our `System` struct.
sys.refresh_all();
Expand Down
10 changes: 1 addition & 9 deletions benches/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ fn bench_new(b: &mut test::Bencher) {
});
}

#[cfg(feature = "system")]
#[bench]
fn bench_new_all(b: &mut test::Bencher) {
b.iter(|| {
sysinfo::System::new_all();
});
}

#[cfg(feature = "system")]
#[bench]
fn bench_refresh_all(b: &mut test::Bencher) {
let mut s = sysinfo::System::new_all();
let mut s = sysinfo::System::new();

b.iter(move || {
s.refresh_all();
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ fn interpret_input(

fn main() {
println!("Getting system information...");
let mut system = System::new_all();
let mut system = System::new();
let mut networks = Networks::new_with_refreshed_list();
let mut disks = Disks::new_with_refreshed_list();
let mut components = Components::new_with_refreshed_list();
Expand Down
2 changes: 1 addition & 1 deletion md_doc/serde.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ With the `serde` feature enabled, you can then serialize `sysinfo` types. Let's
```
use sysinfo::System;

let mut sys = System::new_all();
let mut sys = System::new();
// First we update all information of our `System` struct.
sys.refresh_all();

Expand Down
Loading