Skip to content

Commit

Permalink
fix: enable flags.enable_gpu by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shurizzle committed Aug 13, 2024
1 parent d9d9e1d commit 289075c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,19 +806,20 @@ fn get_use_battery(args: &BottomArgs, config: &Config) -> bool {
false
}

#[allow(unused_variables)]
#[cfg(feature = "gpu")]
fn get_enable_gpu(args: &BottomArgs, config: &Config) -> bool {
#[cfg(feature = "gpu")]
{
if args.gpu.enable_gpu {
return true;
} else if let Some(flags) = &config.flags {
if let Some(enable_gpu) = flags.enable_gpu {
return enable_gpu;
}
}
if args.gpu.enable_gpu {
return true;
}
config
.flags
.as_ref()
.and_then(|f| f.enable_gpu)
.unwrap_or(false)
}

#[cfg(not(feature = "gpu"))]
fn get_enable_gpu(_: &BottomArgs, _: &Config) -> bool {
false
}

Expand Down

0 comments on commit 289075c

Please sign in to comment.