summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClementTsang <clementjhtsang@gmail.com>2020-01-02 23:42:44 -0500
committerClementTsang <clementjhtsang@gmail.com>2020-01-02 23:42:44 -0500
commit8cc8b47c89ff9397ea8d365cdc9d5ffd995458ac (patch)
tree7cc15f77fe53c8823be1efa5d112594efe0f28dd /src
parent7b902a9470457655852307bc5369a64fcd3e5871 (diff)
Some documentation changes
Diffstat (limited to 'src')
-rw-r--r--src/app/process_killer.rs9
-rw-r--r--src/main.rs2
2 files changed, 4 insertions, 7 deletions
diff --git a/src/app/process_killer.rs b/src/app/process_killer.rs
index 840d2eea..1c4e5117 100644
--- a/src/app/process_killer.rs
+++ b/src/app/process_killer.rs
@@ -34,16 +34,15 @@ impl Process {
/// Kills a process, given a PID.
pub fn kill_process_given_pid(pid: u32) -> crate::utils::error::Result<()> {
if cfg!(target_os = "linux") {
- // Linux
Command::new("kill").arg(pid.to_string()).output()?;
} else if cfg!(target_os = "windows") {
#[cfg(target_os = "windows")]
- let process = Process::open(pid as DWORD)?;
- #[cfg(target_os = "windows")]
- process.kill()?;
+ {
+ let process = Process::open(pid as DWORD)?;
+ process.kill()?;
+ }
} else if cfg!(target_os = "macos") {
// TODO: macOS
- // See how sysinfo does it... https://docs.rs/sysinfo/0.9.5/sysinfo/trait.ProcessExt.html
return Err(BottomError::GenericError {
message: "Sorry, macOS support is not implemented yet!".to_string(),
});
diff --git a/src/main.rs b/src/main.rs
index 644d1e96..7bf62b0e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -37,8 +37,6 @@ use constants::TICK_RATE_IN_MILLISECONDS;
use data_conversion::*;
use utils::error::{self, BottomError};
-// End imports
-
enum Event<I, J> {
KeyInput(I),
MouseInput(J),