clippy has my family at gunpoint
This commit is contained in:
parent
4bf8b57d5f
commit
e191d600ce
5 changed files with 29 additions and 14 deletions
|
|
@ -32,8 +32,11 @@ pub fn power(power_command_arg: &Option<PowerCommand>, lock_config: LockConf ) -
|
|||
if let Ok(true) = systemctl.exists(target) {
|
||||
debug!("found and starting {}",target);
|
||||
match systemctl.start(target) {
|
||||
Ok(_) => return Ok(todo!("properly handle this return")),
|
||||
Err(_) => return Err(SDUError { message: "Could not start systemctl target".to_string() }),
|
||||
Ok(_) => {
|
||||
debug!("started target [{}] successfully", target);
|
||||
return Ok(())
|
||||
},
|
||||
Err(_) => return Err(SDUError { message: format!("Could not start systemctl target [{}]", target) }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@ pub fn profile(profile_command: &ProfileCommand, profiles_config: Vec<Profile>,
|
|||
//debug!("profile index will start at {}",index_start);
|
||||
let active_profile_index = active_profile_index();
|
||||
match switch_by_index(profiles_config, active_profile_index, preserve_keyboard_order) {
|
||||
Ok(_) => Ok(debug!("successfully initialized sway-desktop-utils")),
|
||||
Ok(_) => {
|
||||
let _: () = debug!("successfully initialized sway-desktop-utils");
|
||||
Ok(())
|
||||
},
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
},
|
||||
|
|
@ -60,26 +63,34 @@ pub fn profile(profile_command: &ProfileCommand, profiles_config: Vec<Profile>,
|
|||
}
|
||||
},
|
||||
Some(ProfileSwitchCommand::Next) => match next(profiles_config, preserve_keyboard_order) {
|
||||
Ok(_) => Ok(debug!("Successfully switched to next profile")),
|
||||
Ok(_) => {
|
||||
let _: () = debug!("Successfully switched to next profile");
|
||||
Ok(())
|
||||
},
|
||||
Err(e) => Err(e),
|
||||
},
|
||||
Some(ProfileSwitchCommand::Prev) => match previous(profiles_config, preserve_keyboard_order) {
|
||||
Ok(_) => Ok(debug!("successfully switched to previous profile")),
|
||||
Ok(_) => {
|
||||
let _: () = debug!("successfully switched to previous profile");
|
||||
Ok(())
|
||||
},
|
||||
Err(e) => Err(e),
|
||||
},
|
||||
None => {
|
||||
Ok(for profile in profiles_config {
|
||||
let _: () = for profile in profiles_config {
|
||||
println!("{} {}", profile.icon, profile.name);
|
||||
})
|
||||
};
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
},
|
||||
ProfileCommand::Get { get_command, monitor } => {
|
||||
let profile_detail = get_command.clone().unwrap_or(ProfileGetCommand::Json);
|
||||
println!("{}",get::profile_info(profiles_config.clone(),profile_detail.clone()));
|
||||
Ok(if monitor.unwrap_or_default() {
|
||||
let _: () = if monitor.unwrap_or_default() {
|
||||
let _ = get::watch(profiles_config, profile_detail,get_xdg_dirs().runtime_dir.expect("XDG Runtime dir could not be found").join("sway-desktop-utils/active-profile.json").to_str().expect("could not create str from path").to_string());
|
||||
})
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
ProfileCommand::Shortcuts { shortcut_command } => {
|
||||
let active_profile = active_profile(profiles_config).expect("could not determine active profile");
|
||||
|
|
|
|||
|
|
@ -21,13 +21,14 @@ pub fn sway( sway_command: &SwayCommand, window_icons: &[WindowIcon] ) -> Result
|
|||
SwayGetCommand::Full => get_sway_info(window_icons),
|
||||
};
|
||||
println!("{}",sway_json);
|
||||
Ok(if monitor.unwrap_or_default() {
|
||||
let _: () = if monitor.unwrap_or_default() {
|
||||
let event_monitors = match requested_info {
|
||||
SwayGetCommand::Workspaces => vec![EventType::Workspace],
|
||||
SwayGetCommand::Window | SwayGetCommand::Full => vec![EventType::Window,EventType::Workspace],
|
||||
};
|
||||
sway_ipc::monitor_events(event_monitors, requested_info, window_icons);
|
||||
})
|
||||
};
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -21,8 +21,8 @@ pub fn run_sway_command(sway_connection: &mut Connection,payload: String) -> Res
|
|||
match sway_connection.run_command(&payload) {
|
||||
Ok(sway_result) => {
|
||||
debug!("{:#?}", sway_result);
|
||||
println!("Command [{}] ran successfully",payload);
|
||||
Ok(todo!("properly handle this exit"))
|
||||
debug!("Command [{}] ran successfully",payload);
|
||||
Ok(())
|
||||
},
|
||||
Err(e) => Err(SDUError{ message: e.to_string() }),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#![warn(unused_crate_dependencies)]
|
||||
#![allow(clippy::restriction)]
|
||||
#![allow(clippy::style)]
|
||||
|
||||
mod config;
|
||||
#[path = "lib/windows.rs"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue