aboutsummaryrefslogtreecommitdiff
path: root/src/queue.rs
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-05-01 12:08:56 +0530
committerkrolxon <krolyxon@tutanota.com>2024-05-01 12:08:56 +0530
commit955532893fc6db5a78f88ef2a2700dec56cd3012 (patch)
tree452e05bd0c8aa959c824ba49655ecc7c37c1b327 /src/queue.rs
parentb29846fb72326dc04bc13fe11d07965879787533 (diff)
remove queue struct, and use generics of ContentList
Diffstat (limited to 'src/queue.rs')
-rwxr-xr-xsrc/queue.rs41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/queue.rs b/src/queue.rs
deleted file mode 100755
index 712bc2f..0000000
--- a/src/queue.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-use mpd::Song;
-
-#[derive(Debug)]
-pub struct Queue {
- pub list: Vec<Song>,
- pub index: usize,
-}
-
-impl Queue {
- pub fn new() -> Self {
- Queue {
- list: Vec::new(),
- index: 0,
- }
- }
-
- // Go to next item in list
- pub fn next(&mut self) {
- let len = self.list.len();
- if len != 0 && self.index < len - 1 {
- self.index += 1;
- }
- }
-
- /// Go to previous item in list
- pub fn prev(&mut self) {
- if self.index != 0 {
- self.index -= 1;
- }
- }
-
- pub fn reset_index(&mut self) {
- self.index = 0;
- }
-}
-
-impl Default for Queue {
- fn default() -> Self {
- Self::new()
- }
-}