1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-05 04:47:58 +00:00

fix: allow compilation without battery feature (#3435)

This commit is contained in:
David Knaack 2022-01-14 22:12:10 +01:00 committed by GitHub
parent 0b6ffca35d
commit 8985499c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ use std::env;
use std::ffi::{OsStr, OsString};
use std::fmt::Debug;
use std::fs;
use std::marker::PhantomData;
use std::num::ParseIntError;
use std::path::{Path, PathBuf};
use std::string::String;
@ -70,6 +71,9 @@ pub struct Context<'a> {
/// Starship root config
pub root_config: StarshipRootConfig,
/// Avoid issues with unused lifetimes when features are disabled
_marker: PhantomData<&'a ()>,
}
impl<'a> Context<'a> {
@ -149,6 +153,7 @@ impl<'a> Context<'a> {
#[cfg(feature = "battery")]
battery_info_provider: &crate::modules::BatteryInfoProviderImpl,
root_config,
_marker: PhantomData,
}
}