1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-01 01:04:00 +00:00

style: fix name of battery info provider implementation (#2836)

* fix name of battery info implementation

* empty commit for squash
This commit is contained in:
Andrew Houts 2021-06-29 20:12:59 -05:00 committed by GitHub
parent 53a30046d1
commit 5901ec026f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ impl<'a> Context<'a> {
#[cfg(test)] #[cfg(test)]
cmd: HashMap::new(), cmd: HashMap::new(),
#[cfg(feature = "battery")] #[cfg(feature = "battery")]
battery_info_provider: &crate::modules::BatteryStatusProviderImpl, battery_info_provider: &crate::modules::BatteryInfoProviderImpl,
cmd_timeout, cmd_timeout,
} }
} }

View File

@ -130,9 +130,9 @@ pub trait BatteryInfoProvider {
fn get_battery_info(&self) -> Option<BatteryInfo>; fn get_battery_info(&self) -> Option<BatteryInfo>;
} }
pub struct BatteryStatusProviderImpl; pub struct BatteryInfoProviderImpl;
impl BatteryInfoProvider for BatteryStatusProviderImpl { impl BatteryInfoProvider for BatteryInfoProviderImpl {
fn get_battery_info(&self) -> Option<BatteryInfo> { fn get_battery_info(&self) -> Option<BatteryInfo> {
let battery_manager = battery::Manager::new().ok()?; let battery_manager = battery::Manager::new().ok()?;
let batteries = battery_manager.batteries().ok()?; let batteries = battery_manager.batteries().ok()?;

View File

@ -65,7 +65,7 @@ mod zig;
mod battery; mod battery;
#[cfg(feature = "battery")] #[cfg(feature = "battery")]
pub use self::battery::{BatteryInfoProvider, BatteryStatusProviderImpl}; pub use self::battery::{BatteryInfoProvider, BatteryInfoProviderImpl};
use crate::config::RootModuleConfig; use crate::config::RootModuleConfig;
use crate::context::{Context, Shell}; use crate::context::{Context, Shell};