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:
parent
53a30046d1
commit
5901ec026f
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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()?;
|
||||||
|
@ -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};
|
||||||
|
Loading…
Reference in New Issue
Block a user