From 8985499c958cab961914286308f46e1622ceb038 Mon Sep 17 00:00:00 2001 From: David Knaack Date: Fri, 14 Jan 2022 22:12:10 +0100 Subject: [PATCH] fix: allow compilation without battery feature (#3435) --- src/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/context.rs b/src/context.rs index ee81cf62..1d582a56 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, } }