Remove unused code
This commit is contained in:
parent
47d67022f0
commit
a03971c019
2 changed files with 2 additions and 35 deletions
|
|
@ -154,7 +154,7 @@ impl<Id: Clone + Eq> List<Id> {
|
||||||
pub fn move_cursor_up(&mut self, height: usize, rows: &[Row<Id>]) {
|
pub fn move_cursor_up(&mut self, height: usize, rows: &[Row<Id>]) {
|
||||||
self.stabilize(height, rows);
|
self.stabilize(height, rows);
|
||||||
|
|
||||||
self.cursor = if let Some((cid, cidx)) = &self.cursor {
|
self.cursor = if let Some((_, cidx)) = &self.cursor {
|
||||||
Self::selectable_before_index(rows, *cidx).or_else(|| Self::first_selectable(rows))
|
Self::selectable_before_index(rows, *cidx).or_else(|| Self::first_selectable(rows))
|
||||||
} else {
|
} else {
|
||||||
Self::last_selectable(rows)
|
Self::last_selectable(rows)
|
||||||
|
|
@ -167,7 +167,7 @@ impl<Id: Clone + Eq> List<Id> {
|
||||||
pub fn move_cursor_down(&mut self, height: usize, rows: &[Row<Id>]) {
|
pub fn move_cursor_down(&mut self, height: usize, rows: &[Row<Id>]) {
|
||||||
self.stabilize(height, rows);
|
self.stabilize(height, rows);
|
||||||
|
|
||||||
self.cursor = if let Some((cid, cidx)) = &self.cursor {
|
self.cursor = if let Some((_, cidx)) = &self.cursor {
|
||||||
Self::selectable_after_index(rows, *cidx).or_else(|| Self::last_selectable(rows))
|
Self::selectable_after_index(rows, *cidx).or_else(|| Self::last_selectable(rows))
|
||||||
} else {
|
} else {
|
||||||
Self::first_selectable(rows)
|
Self::first_selectable(rows)
|
||||||
|
|
|
||||||
|
|
@ -18,24 +18,6 @@ use super::list::{List, Row};
|
||||||
use super::room::EuphRoom;
|
use super::room::EuphRoom;
|
||||||
use super::{util, UiEvent};
|
use super::{util, UiEvent};
|
||||||
|
|
||||||
mod style {
|
|
||||||
use crossterm::style::{ContentStyle, Stylize};
|
|
||||||
|
|
||||||
pub fn room() -> ContentStyle {
|
|
||||||
ContentStyle::default().bold().blue()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn room_inverted() -> ContentStyle {
|
|
||||||
ContentStyle::default().bold().black().on_white()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Copy)]
|
|
||||||
struct Cursor {
|
|
||||||
index: usize,
|
|
||||||
line: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Rooms {
|
pub struct Rooms {
|
||||||
vault: Vault,
|
vault: Vault,
|
||||||
ui_event_tx: mpsc::UnboundedSender<UiEvent>,
|
ui_event_tx: mpsc::UnboundedSender<UiEvent>,
|
||||||
|
|
@ -59,21 +41,6 @@ impl Rooms {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn rooms(&self) -> Vec<String> {
|
|
||||||
let mut rooms = HashSet::new();
|
|
||||||
for room in self.vault.euph_rooms().await {
|
|
||||||
rooms.insert(room);
|
|
||||||
}
|
|
||||||
for (name, room) in &self.euph_rooms {
|
|
||||||
if !room.stopped() {
|
|
||||||
rooms.insert(name.clone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let mut rooms = rooms.into_iter().collect::<Vec<_>>();
|
|
||||||
rooms.sort_unstable();
|
|
||||||
rooms
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Remove rooms that are not running any more and can't be found in the db.
|
/// Remove rooms that are not running any more and can't be found in the db.
|
||||||
///
|
///
|
||||||
/// These kinds of rooms are either
|
/// These kinds of rooms are either
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue