History

Adapt `gitoxide-core` to changes in `sysinfo`

Bumping the `sysinfo` dependency of `gitoxide-core` from 0.31.2 to 0.34.2 broke `RefreshKind::new()` and `CpuRefreshKind::new()` calls because `sysinfo` 0.33.0 renamed those `new()` to `nothing()`: https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md#0330 This renames the calls accordingly.

Eliah Kagan committed 1 year ago

Commit 417917f1 parent 8e5e68f1 file · +4 −3Browse files

Unified · Split

gitoxide-core/src/corpus/db.rs+4−3
@@ -118,7 +118,7 @@ pub fn create(path: impl AsRef<std::path::Path>) -> anyhow::Result<rusqlite::Con · 117 unmodified lines
118 CREATE TABLE if not exists task(118 CREATE TABLE if not exists task(
119 id integer PRIMARY KEY,119 id integer PRIMARY KEY,
120 short_name UNIQUE, -- the unique and permanent identifier for the task120 short_name UNIQUE, -- the unique and permanent identifier for the task
121 description text UNIQUE -- the descriptive name of the task, it can be changed at will 121 description text UNIQUE -- the descriptive name of the task, it can be changed at will
122 )122 )
123 "#,123 "#,
124 )?;124 )?;
@@ -148,8 +148,9 @@ pub fn create(path: impl AsRef<std::path::Path>) -> anyhow::Result<rusqlite::Con · 23 unmodified lines
148/// Utilities148/// Utilities
149impl Engine {149impl Engine {
150 pub(crate) fn runner_id_or_insert(&self) -> anyhow::Result<Id> {150 pub(crate) fn runner_id_or_insert(&self) -> anyhow::Result<Id> {
151 let sys =151 let sys = sysinfo::System::new_with_specifics(
152 sysinfo::System::new_with_specifics(RefreshKind::new().with_cpu(CpuRefreshKind::new().with_frequency()));152 RefreshKind::nothing().with_cpu(CpuRefreshKind::nothing().with_frequency()),
153 );
153 let cpu = &sys.cpus()[0];154 let cpu = &sys.cpus()[0];
154 let vendor = Some(cpu.vendor_id().to_owned());155 let vendor = Some(cpu.vendor_id().to_owned());
155 let host = sysinfo::System::host_name();156 let host = sysinfo::System::host_name();