From 9df7c7d256a1a6da296b40a233d44ee86d48d431 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Tue, 9 Nov 2021 11:35:45 +0000 Subject: [PATCH] fix: replace battery with starship-battery (#3213) --- Cargo.lock | 48 ++++++++++++++++-------------------------- Cargo.toml | 3 ++- src/modules/battery.rs | 1 + 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1560aa57..0849a704 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Cargo.toml b/Cargo.toml index 4e646a94..09cc8f3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/modules/battery.rs b/src/modules/battery.rs index 90cbaef3..3942dea5 100644 --- a/src/modules/battery.rs +++ b/src/modules/battery.rs @@ -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;