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:
parent
cee50fffb8
commit
ef96646f1c
48
Cargo.lock
generated
48
Cargo.lock
generated
@ -332,23 +332,6 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
|||||||
name = "base91"
|
name = "base91"
|
||||||
version = "0.1.0"
|
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]]
|
[[package]]
|
||||||
name = "benchmarking"
|
name = "benchmarking"
|
||||||
version = "0.4.11"
|
version = "0.4.11"
|
||||||
@ -659,7 +642,6 @@ name = "config"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"battery",
|
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bstr 0.2.17",
|
"bstr 0.2.17",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -683,6 +665,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"shlex",
|
"shlex",
|
||||||
"smol",
|
"smol",
|
||||||
|
"starship-battery",
|
||||||
"terminfo",
|
"terminfo",
|
||||||
"termwiz",
|
"termwiz",
|
||||||
"toml",
|
"toml",
|
||||||
@ -2348,18 +2331,6 @@ dependencies = [
|
|||||||
"winapi 0.3.9",
|
"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]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.22.3"
|
version = "0.22.3"
|
||||||
@ -3868,6 +3839,23 @@ dependencies = [
|
|||||||
"parking_lot 0.11.2",
|
"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]]
|
[[package]]
|
||||||
name = "static_assertions"
|
name = "static_assertions"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -12,7 +12,7 @@ env_logger = "0.9"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
battery = "0.7"
|
starship-battery = "0.7"
|
||||||
bitflags = "1.3"
|
bitflags = "1.3"
|
||||||
bstr = "0.2"
|
bstr = "0.2"
|
||||||
chrono = {version="0.4", features=["unstable-locales"]}
|
chrono = {version="0.4", features=["unstable-locales"]}
|
||||||
|
@ -391,7 +391,7 @@ fn opt_string(s: Option<&str>) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn battery_info<'lua>(_: &'lua Lua, _: ()) -> mlua::Result<Vec<BatteryInfo>> {
|
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 manager = Manager::new().map_err(|e| mlua::Error::external(e))?;
|
||||||
let mut result = vec![];
|
let mut result = vec![];
|
||||||
for b in manager.batteries().map_err(|e| mlua::Error::external(e))? {
|
for b in manager.batteries().map_err(|e| mlua::Error::external(e))? {
|
||||||
|
Loading…
Reference in New Issue
Block a user