diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-05-01 18:25:57 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-05-01 18:25:57 -0400 |
commit | 08b6345e4e03dbd30f7eef2c0eba18b3bf9981a7 (patch) | |
tree | 0e81e89ad4485e906b61503e2d38f692dfe2e7a8 /src/context | |
parent | 4cdb291fc36ae71cd9514d5e030f60ff5712eda3 (diff) |
make index public attribute
- remove unused code and add #[allow(dead_code)]
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/tab_context.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/context/tab_context.rs b/src/context/tab_context.rs index f199d4a..b7d7b0a 100644 --- a/src/context/tab_context.rs +++ b/src/context/tab_context.rs @@ -1,9 +1,9 @@ -use crate::tab::JoshutoTab; +use std::slice::IterMut; -use std::slice::{Iter, IterMut}; +use crate::tab::JoshutoTab; pub struct TabContext { - index: usize, + pub index: usize, tabs: Vec<JoshutoTab>, } @@ -21,14 +21,6 @@ impl TabContext { Self::default() } - pub fn get_index(&self) -> usize { - self.index - } - - pub fn set_index(&mut self, index: usize) { - self.index = index; - } - pub fn len(&self) -> usize { self.tabs.len() } @@ -54,10 +46,6 @@ impl TabContext { self.tabs.remove(index) } - pub fn iter(&self) -> Iter<JoshutoTab> { - self.tabs.iter() - } - pub fn iter_mut(&mut self) -> IterMut<JoshutoTab> { self.tabs.iter_mut() } |