Skip to content

Commit af60d22

Browse files
Merge pull request #1567 from GuillaumeGomez/msrv
Update minimum supported rust version to 1.88
2 parents 14f55d3 + 5fa1b50 commit af60d22

File tree

23 files changed

+145
-153
lines changed

23 files changed

+145
-153
lines changed

.cirrus.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
task:
2-
name: rust 1.85 on freebsd 13
2+
name: rust 1.88 on freebsd 13
33
freebsd_instance:
44
image: freebsd-13-1-release-amd64
55
setup_script:
66
- curl https://sh.rustup.rs -sSf --output rustup.sh
7-
- sh rustup.sh -y --profile=minimal --default-toolchain=1.85
7+
- sh rustup.sh -y --profile=minimal --default-toolchain=1.88
88
- . $HOME/.cargo/env
99
- rustup --version
1010
- rustup component add clippy
@@ -59,14 +59,14 @@ task:
5959
- FREEBSD_CI=1 cargo test --lib -- --test-threads=1
6060

6161
task:
62-
name: rust 1.85 on mac m1
62+
name: rust 1.88 on mac m1
6363
macos_instance:
6464
image: ghcr.io/cirruslabs/macos-monterey-base:latest
6565
setup_script:
6666
- brew update
6767
- brew install curl
6868
- curl https://sh.rustup.rs -sSf --output rustup.sh
69-
- sh rustup.sh -y --profile=minimal --default-toolchain=1.85
69+
- sh rustup.sh -y --profile=minimal --default-toolchain=1.88
7070
- source $HOME/.cargo/env
7171
- rustup --version
7272
- rustup component add clippy

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- { os: 'ubuntu-latest', target: 'x86_64-linux-android', cross: true }
7474
- { os: 'ubuntu-latest', target: 'i686-linux-android', cross: true }
7575
toolchain:
76-
- "1.85.0" # minimum supported rust version
76+
- "1.88.0" # minimum supported rust version
7777
- stable
7878
- nightly
7979
steps:
@@ -240,7 +240,7 @@ jobs:
240240
- macos-latest
241241
- windows-latest
242242
toolchain:
243-
- "1.85.0" # minimum supported rust version
243+
- "1.88.0" # minimum supported rust version
244244
- stable
245245
- nightly
246246
steps:
@@ -302,7 +302,7 @@ jobs:
302302
strategy:
303303
matrix:
304304
toolchain:
305-
- "1.85.0" # minimum supported rust version
305+
- "1.88.0" # minimum supported rust version
306306
- stable
307307
steps:
308308
- uses: actions/checkout@v4

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Library to get system information such as processes, CPUs, disks,
66
repository = "https://github.com/GuillaumeGomez/sysinfo"
77
license = "MIT"
88
readme = "README.md"
9-
rust-version = "1.85"
9+
rust-version = "1.88"
1010
exclude = ["/test-unknown"]
1111
keywords = ["system-information", "disk", "process", "network", "cpu"]
1212
edition = "2024"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can still use `sysinfo` on non-supported OSes, it'll simply do nothing and a
1818
empty values. You can check in your program directly if an OS is supported by checking the
1919
[`IS_SUPPORTED_SYSTEM`] constant.
2020

21-
The minimum-supported version of `rustc` is **1.85**.
21+
The minimum-supported version of `rustc` is **1.88**.
2222

2323
## Usage
2424

src/common/system.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ impl System {
359359
}
360360
}
361361
fn update(pid: &Pid, processes: &mut HashMap<Pid, Process>) {
362-
if let Some(proc) = processes.get_mut(pid) {
363-
if !proc.inner.switch_updated() {
364-
proc.inner.set_nonexistent();
365-
}
362+
if let Some(proc) = processes.get_mut(pid)
363+
&& !proc.inner.switch_updated()
364+
{
365+
proc.inner.set_nonexistent();
366366
}
367367
}
368368

src/unix/apple/macos/disk.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ where
6868
)
6969
};
7070

71-
if let Some(properties) = properties_result {
72-
if let Ok(properties) = properties.downcast::<CFDictionary>() {
73-
if let Some(result) = eval(parent_entry, &properties) {
74-
return Some(result);
75-
}
76-
}
71+
if let Some(properties) = properties_result
72+
&& let Ok(properties) = properties.downcast::<CFDictionary>()
73+
&& let Some(result) = eval(parent_entry, &properties)
74+
{
75+
return Some(result);
7776
}
7877
}
7978
}

src/unix/apple/macos/process.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ impl ProcessInner {
164164
pub(crate) fn status(&self) -> ProcessStatus {
165165
// If the status is `Run`, then it's very likely wrong so we instead
166166
// return a `ProcessStatus` converted from the `ThreadStatus`.
167-
if self.process_status == ProcessStatus::Run {
168-
if let Some(thread_status) = self.status {
169-
return ProcessStatus::from(thread_status);
170-
}
167+
if self.process_status == ProcessStatus::Run
168+
&& let Some(thread_status) = self.status
169+
{
170+
return ProcessStatus::from(thread_status);
171171
}
172172
self.process_status
173173
}

src/unix/freebsd/component.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ impl ComponentInner {
4747
pub(crate) fn refresh(&mut self) {
4848
unsafe {
4949
self.temperature = refresh_component(&self.id);
50-
if let Some(temperature) = self.temperature {
51-
if temperature > self.max {
52-
self.max = temperature;
53-
}
50+
if let Some(temperature) = self.temperature
51+
&& temperature > self.max
52+
{
53+
self.max = temperature;
5454
}
5555
}
5656
}

src/unix/freebsd/disk.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,20 @@ fn get_disks_mapping() -> HashMap<String, String> {
296296
for line in mapping.lines() {
297297
let mut parts = line.split_whitespace();
298298
let Some(kind) = parts.next() else { continue };
299+
300+
#[allow(clippy::collapsible_if)]
299301
if kind == "0" {
300-
if let Some("DISK") = parts.next() {
301-
if let Some(id) = parts.next() {
302-
last_id.clear();
303-
last_id.push_str(id);
304-
}
302+
if let Some("DISK") = parts.next()
303+
&& let Some(id) = parts.next()
304+
{
305+
last_id.clear();
306+
last_id.push_str(id);
305307
}
306308
} else if kind == "2" && !last_id.is_empty() {
307-
if let Some("LABEL") = parts.next() {
308-
if let Some(path) = parts.next() {
309-
disk_mapping.insert(format!("/dev/{path}"), last_id.clone());
310-
}
309+
if let Some("LABEL") = parts.next()
310+
&& let Some(path) = parts.next()
311+
{
312+
disk_mapping.insert(format!("/dev/{path}"), last_id.clone());
311313
}
312314
}
313315
}

src/unix/linux/cpu.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ pub(crate) fn get_cpu_frequency(cpu_core_index: usize) -> u64 {
447447
.is_ok()
448448
{
449449
let freq_option = s.trim().split('\n').next();
450-
if let Some(freq_string) = freq_option {
451-
if let Ok(freq) = freq_string.parse::<u64>() {
452-
return freq / 1000;
453-
}
450+
if let Some(freq_string) = freq_option
451+
&& let Ok(freq) = freq_string.parse::<u64>()
452+
{
453+
return freq / 1000;
454454
}
455455
}
456456
s.clear();

0 commit comments

Comments
 (0)