Skip to content

Commit

Permalink
Merge pull request #1103 from GuillaumeGomez/cleanup
Browse files Browse the repository at this point in the history
Remove `sort_by` methods and rename getters into `list` and `list_mut`
  • Loading branch information
GuillaumeGomez authored Oct 17, 2023
2 parents 0eca9ce + 7dec818 commit ade89e3
Show file tree
Hide file tree
Showing 18 changed files with 97 additions and 175 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ println!("=> disks:");
let mut disks = Disks::new();
// We refresh the disk list.
disks.refresh_list();
for disk in disks.iter() {
for disk in &disks {
println!("{disk:?}");
}

Expand All @@ -90,7 +90,7 @@ let mut components = Components::new();
// We refresh the component list.
components.refresh_list();
println!("=> components:");
for component in components.iter() {
for component in &components {
println!("{component:?}");
}
```
Expand Down
2 changes: 1 addition & 1 deletion benches/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn bench_refresh_disk(b: &mut test::Bencher) {
let mut disks = sysinfo::Disks::new();
disks.refresh_list();

let disks = disks.disks_mut();
let disks = disks.list_mut();
let disk = &mut disks[0];
b.iter(move || {
disk.refresh();
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,12 @@ fn interpret_input(
}
}
"disks" => {
for disk in disks.disks() {
for disk in disks {
writeln!(&mut io::stdout(), "{disk:?}");
}
}
"users" => {
for user in users.users() {
for user in users {
writeln!(
&mut io::stdout(),
"{:?} => {:?}",
Expand Down
Loading

0 comments on commit ade89e3

Please sign in to comment.