diff options
Diffstat (limited to 'src/joshuto/context.rs')
-rw-r--r-- | src/joshuto/context.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/joshuto/context.rs b/src/joshuto/context.rs index acf972c..b1b8fe2 100644 --- a/src/joshuto/context.rs +++ b/src/joshuto/context.rs @@ -9,7 +9,10 @@ use joshuto::window::JoshutoView; pub struct JoshutoContext { pub username: String, pub hostname: String, - pub threads: Vec<(sync::mpsc::Receiver<command::ProgressInfo>, thread::JoinHandle<i32>)>, + pub threads: Vec<( + sync::mpsc::Receiver<command::ProgressInfo>, + thread::JoinHandle<i32>, + )>, pub views: JoshutoView, pub curr_tab_index: usize, pub tabs: Vec<JoshutoTab>, @@ -18,13 +21,11 @@ pub struct JoshutoContext { } impl<'a> JoshutoContext { - pub fn new(config_t: config::JoshutoConfig) -> Self - { + pub fn new(config_t: config::JoshutoConfig) -> Self { let username: String = whoami::username(); let hostname: String = whoami::hostname(); - let views: JoshutoView = - JoshutoView::new(config_t.column_ratio); + let views: JoshutoView = JoshutoView::new(config_t.column_ratio); JoshutoContext { username, @@ -36,12 +37,10 @@ impl<'a> JoshutoContext { config_t, } } - pub fn curr_tab_ref(&'a self) -> &'a JoshutoTab - { + pub fn curr_tab_ref(&'a self) -> &'a JoshutoTab { &self.tabs[self.curr_tab_index] } - pub fn curr_tab_mut(&'a mut self) -> &'a mut JoshutoTab - { + pub fn curr_tab_mut(&'a mut self) -> &'a mut JoshutoTab { &mut self.tabs[self.curr_tab_index] } } |