1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

deps: migrate battery to starship-battery

The former is unmaintained and is flagging in cargo audit for its
indirect deps.

The starship folks have forked it; let's use that.

refs: https://github.com/svartalf/rust-battery/pull/92
refs: https://github.com/wez/wezterm/issues/1952
This commit is contained in:
Wez Furlong 2022-05-04 20:11:48 -07:00
parent cee50fffb8
commit ef96646f1c
3 changed files with 20 additions and 32 deletions

48
Cargo.lock generated
View File

@ -332,23 +332,6 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
name = "base91"
version = "0.1.0"
[[package]]
name = "battery"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4b624268937c0e0a3edb7c27843f9e547c320d730c610d3b8e6e8e95b2026e4"
dependencies = [
"cfg-if 1.0.0",
"core-foundation 0.7.0",
"lazycell",
"libc",
"mach",
"nix 0.19.1",
"num-traits",
"uom",
"winapi 0.3.9",
]
[[package]]
name = "benchmarking"
version = "0.4.11"
@ -659,7 +642,6 @@ name = "config"
version = "0.1.0"
dependencies = [
"anyhow",
"battery",
"bitflags",
"bstr 0.2.17",
"chrono",
@ -683,6 +665,7 @@ dependencies = [
"serde_json",
"shlex",
"smol",
"starship-battery",
"terminfo",
"termwiz",
"toml",
@ -2348,18 +2331,6 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "nix"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"
dependencies = [
"bitflags",
"cc",
"cfg-if 1.0.0",
"libc",
]
[[package]]
name = "nix"
version = "0.22.3"
@ -3868,6 +3839,23 @@ dependencies = [
"parking_lot 0.11.2",
]
[[package]]
name = "starship-battery"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3336198ad004af4447ae69be4f4e562c26814570f8f0c1e37858405a294e015d"
dependencies = [
"cfg-if 1.0.0",
"core-foundation 0.7.0",
"lazycell",
"libc",
"mach",
"nix 0.23.1",
"num-traits",
"uom",
"winapi 0.3.9",
]
[[package]]
name = "static_assertions"
version = "1.1.0"

View File

@ -12,7 +12,7 @@ env_logger = "0.9"
[dependencies]
anyhow = "1.0"
battery = "0.7"
starship-battery = "0.7"
bitflags = "1.3"
bstr = "0.2"
chrono = {version="0.4", features=["unstable-locales"]}

View File

@ -391,7 +391,7 @@ fn opt_string(s: Option<&str>) -> String {
}
fn battery_info<'lua>(_: &'lua Lua, _: ()) -> mlua::Result<Vec<BatteryInfo>> {
use battery::{Manager, State};
use starship_battery::{Manager, State};
let manager = Manager::new().map_err(|e| mlua::Error::external(e))?;
let mut result = vec![];
for b in manager.batteries().map_err(|e| mlua::Error::external(e))? {