fix: replace battery with starship-battery (#3213)

This commit is contained in:
Matan Kushner 2021-11-09 11:35:45 +00:00 committed by GitHub
parent d1ce352528
commit 9df7c7d256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 31 deletions

48
Cargo.lock generated
View File

@ -105,23 +105,6 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[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",
]
[[package]]
name = "bitflags"
version = "1.3.2"
@ -1006,18 +989,6 @@ dependencies = [
"void",
]
[[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.23.0"
@ -1737,7 +1708,6 @@ version = "0.58.0"
dependencies = [
"ansi_term 0.12.1",
"attohttpc",
"battery",
"byte-unit",
"chrono",
"clap",
@ -1768,6 +1738,7 @@ dependencies = [
"sha-1 0.9.8",
"shadow-rs",
"shell-words",
"starship-battery",
"starship_module_config_derive",
"strsim 0.10.0",
"sys-info",
@ -1784,6 +1755,23 @@ dependencies = [
"yaml-rust",
]
[[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.0",
"num-traits",
"uom",
"winapi",
]
[[package]]
name = "starship_module_config_derive"
version = "0.2.1"

View File

@ -25,6 +25,7 @@ maintenance = { status = "actively-developed" }
[features]
default = ["battery", "http"]
http = ["attohttpc"]
battery = ["starship-battery"]
# Vendor OpenSSL, use this if you have trouble cross-compiling starship
tls-vendored = ["native-tls/vendored"]
@ -41,7 +42,7 @@ rayon = "1.5.1"
log = { version = "0.4.14", features = ["std"] }
# battery is optional (on by default) because the crate doesn't currently build for Termux
# see: https://github.com/svartalf/rust-battery/issues/33
battery = { version = "0.7.8", optional = true }
starship-battery = { version = "0.7.9", optional = true }
path-slash = "0.1.4"
unicode-segmentation = "1.8.0"
gethostname = "0.2.1"

View File

@ -2,6 +2,7 @@ use super::{Context, Module, RootModuleConfig};
use crate::configs::battery::BatteryConfig;
#[cfg(test)]
use mockall::automock;
use starship_battery as battery;
use crate::formatter::StringFormatter;