Skip to content

Commit dfa6982

Browse files
author
Deren Vural
committed
trunk formatting fixes
Signed-off-by: Deren Vural <[email protected]>
1 parent e8e6514 commit dfa6982

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

src/main.rs

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,17 @@
2121
// Modules
2222
mod custom_button;
2323
//use custom_button::CustomButton;
24-
mod subprocess;
2524
mod processor;
25+
mod subprocess;
2626

2727
// Imports
28-
use std::ffi::OsStr;
2928
use gtk::prelude::*;
3029
use gtk::{
31-
/* Libraries */ gio,
32-
/* Application */ Application, ApplicationWindow,
30+
/* Libraries */ gio, /* Application */ Application, ApplicationWindow,
3331
/* Widgets */ Button,
3432
};
3533
use processor::Processor;
34+
use std::ffi::OsStr;
3635
//use std::env;
3736
//use std::path::Path;
3837
//use libappindicator::{
@@ -70,7 +69,10 @@ fn build_ui(app: &Application) {
7069
button1.connect_clicked(move |_| {
7170
match subprocess::exec_check(&[OsStr::new("nvidia-settings")], None::<&gio::Cancellable>) {
7271
Ok(_x) => println!("Opening the Nvidia Settings app.."),
73-
Err(y) => println!("An error occured while opening the Nvidia Settings app: {}", y.message()),
72+
Err(y) => println!(
73+
"An error occured while opening the Nvidia Settings app: {}",
74+
y.message()
75+
),
7476
};
7577
});
7678
// Button Child 2
@@ -95,21 +97,30 @@ fn build_ui(app: &Application) {
9597
Ok(return_val) => match return_val {
9698
(None, None) => println!("no stdout or stderr, something went really wrong..."),
9799
(None, Some(stderr_buffer)) => match std::str::from_utf8(&stderr_buffer) {
98-
Ok(stderr_buffer_contents) => println!("Process failed with error: {}", stderr_buffer_contents),
100+
Ok(stderr_buffer_contents) => {
101+
println!("Process failed with error: {}", stderr_buffer_contents)
102+
}
99103
Err(err) => panic!("{}", err),
100104
},
101105
(Some(stdout_buffer), None) => match std::str::from_utf8(&stdout_buffer) {
102-
Ok(stdout_buffer_contents) => println!("Process suceeded, returning: {}", stdout_buffer_contents),
106+
Ok(stdout_buffer_contents) => {
107+
println!("Process suceeded, returning: {}", stdout_buffer_contents)
108+
}
103109
Err(err) => panic!("{}", err),
104110
},
105-
(Some(stdout_buffer), Some(stderr_buffer)) => match std::str::from_utf8(&stdout_buffer) {
106-
Ok(stdout_buffer_contents) => match std::str::from_utf8(&stderr_buffer) {
107-
Ok(stderr_buffer_contents) => println!("Process suceeded, returning: {} but with error: {}", stdout_buffer_contents, stderr_buffer_contents),
111+
(Some(stdout_buffer), Some(stderr_buffer)) => {
112+
match std::str::from_utf8(&stdout_buffer) {
113+
Ok(stdout_buffer_contents) => match std::str::from_utf8(&stderr_buffer) {
114+
Ok(stderr_buffer_contents) => println!(
115+
"Process suceeded, returning: {} but with error: {}",
116+
stdout_buffer_contents, stderr_buffer_contents
117+
),
118+
Err(err) => panic!("{}", err),
119+
},
108120
Err(err) => panic!("{}", err),
109-
},
110-
Err(err) => panic!("{}", err),
111-
},
112-
}
121+
}
122+
}
123+
},
113124
Err(err) => println!("something went wrong: {}", err),
114125
};
115126
});

0 commit comments

Comments
 (0)