diff options
author | David Knaack <davidkna@users.noreply.github.com> | 2022-01-14 22:12:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 22:12:10 +0100 |
commit | 8985499c958cab961914286308f46e1622ceb038 (patch) | |
tree | 79214e731fea2a092a2e7fd76839d68015a66faf | |
parent | 0b6ffca35d7a129bb629a192b51cdfc637b6a4a8 (diff) |
fix: allow compilation without battery feature (#3435)
-rw-r--r-- | src/context.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/context.rs b/src/context.rs index ee81cf62f..1d582a56c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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, } } |