mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Clean up unwrap()'s. Print out info in asusctl if error
This commit is contained in:
@@ -100,15 +100,15 @@ impl CtrlPlatformProfile {
|
||||
|
||||
match config.active {
|
||||
Profile::Balanced => {
|
||||
Profile::set_profile(Profile::Performance);
|
||||
Profile::set_profile(Profile::Performance)?;
|
||||
config.active = Profile::Performance;
|
||||
}
|
||||
Profile::Performance => {
|
||||
Profile::set_profile(Profile::Quiet);
|
||||
Profile::set_profile(Profile::Quiet)?;
|
||||
config.active = Profile::Quiet;
|
||||
}
|
||||
Profile::Quiet => {
|
||||
Profile::set_profile(Profile::Balanced);
|
||||
Profile::set_profile(Profile::Balanced)?;
|
||||
config.active = Profile::Balanced;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,9 @@ impl ProfileZbus {
|
||||
if let Ok(mut cfg) = ctrl.config.try_lock() {
|
||||
// Read first just incase the user has modified the config before calling this
|
||||
cfg.read();
|
||||
Profile::set_profile(profile);
|
||||
Profile::set_profile(profile)
|
||||
.map_err(|e| warn!("Profile::set_profile, {}", e))
|
||||
.ok();
|
||||
cfg.active = profile;
|
||||
}
|
||||
ctrl.save_config();
|
||||
|
||||
Reference in New Issue
Block a user