Skip to content

Commit

Permalink
dependency updates and resulting necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CraZySacX committed Jul 22, 2022
1 parent 5997a34 commit 8b20805
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ local_offset = ["time/local-offset"]
[dependencies]
anyhow = "1"
cfg-if = "1"
enum-iterator = "0.7"
enum-iterator = "1.1.3"
getset = "0"
git2 = { version = "0", optional = true, default-features = false }
rustc_version = { version = "0.4.0", optional = true }
sysinfo = { version = "=0.23", optional = true, default-features = false }
sysinfo = { version = "0.24.7", optional = true, default-features = false }
thiserror = "1"
time = { version = "0.3.7", optional = true }

Expand Down
11 changes: 8 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::{
},
};
use anyhow::Result;
use enum_iterator::IntoEnumIterator;
use enum_iterator::{all, Sequence};
use getset::{Getters, MutGetters};
use std::{
collections::BTreeMap,
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Instructions {
}

/// Build information keys.
#[derive(Clone, Copy, Debug, IntoEnumIterator, Hash, Eq, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, Sequence)]
pub(crate) enum VergenKey {
/// The build date. (VERGEN_BUILD_DATE)
BuildDate,
Expand Down Expand Up @@ -288,7 +288,12 @@ pub(crate) struct Config {
impl Default for Config {
fn default() -> Config {
Self {
cfg_map: VergenKey::into_enum_iter().map(|x| (x, None)).collect(),
cfg_map: all::<VergenKey>()
.collect::<Vec<_>>()
.iter()
.copied()
.map(|x| (x, None))
.collect(),
head_path: Option::default(),
ref_path: Option::default(),
}
Expand Down
12 changes: 6 additions & 6 deletions src/feature/si.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use {
use {
crate::{config::VergenKey, feature::add_entry},
getset::{Getters, MutGetters},
sysinfo::{ProcessorExt, System, SystemExt},
sysinfo::{CpuExt, System, SystemExt},
};

/// Configuration for the `VERGEN_SYSINFO_*` instructions
Expand Down Expand Up @@ -199,7 +199,7 @@ pub(crate) fn configure_sysinfo(instructions: &Instructions, config: &mut Config
config.cfg_map_mut(),
VergenKey::SysinfoCpuVendor,
system
.processors()
.cpus()
.get(0)
.map(|processor| processor.vendor_id().to_string()),
);
Expand All @@ -219,9 +219,9 @@ pub(crate) fn configure_sysinfo(instructions: &Instructions, config: &mut Config
VergenKey::SysinfoCpuName,
Some(
system
.processors()
.cpus()
.iter()
.map(ProcessorExt::name)
.map(CpuExt::name)
.collect::<Vec<&str>>()
.join(","),
),
Expand All @@ -233,7 +233,7 @@ pub(crate) fn configure_sysinfo(instructions: &Instructions, config: &mut Config
config.cfg_map_mut(),
VergenKey::SysinfoCpuBrand,
system
.processors()
.cpus()
.get(0)
.map(|processor| processor.brand().to_string()),
);
Expand All @@ -244,7 +244,7 @@ pub(crate) fn configure_sysinfo(instructions: &Instructions, config: &mut Config
config.cfg_map_mut(),
VergenKey::SysinfoCpuFrequency,
system
.processors()
.cpus()
.get(0)
.map(|processor| processor.frequency().to_string()),
);
Expand Down

0 comments on commit 8b20805

Please sign in to comment.