diff --git a/src/modules/singularity.rs b/src/modules/singularity.rs index a6ec73b83..30c3106d8 100644 --- a/src/modules/singularity.rs +++ b/src/modules/singularity.rs @@ -7,8 +7,7 @@ use crate::formatter::StringFormatter; /// /// Will display the Singularity image if `$SINGULARITY_NAME` is set. pub fn module<'a>(context: &'a Context) -> Option> { - let singularity_env = context.get_env("SINGULARITY_NAME"); - singularity_env.as_ref()?; + let singularity_env = context.get_env("SINGULARITY_NAME")?; let mut module = context.new_module("singularity"); let config: SingularityConfig = SingularityConfig::try_load(module.config); @@ -24,7 +23,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { _ => None, }) .map(|variable| match variable { - "env" => singularity_env.as_ref().map(Ok), + "env" => Some(Ok(&singularity_env)), _ => None, }) .parse(None)