diff options
| author | Felix Kaaman <tmtu@tmtu.ee> | 2020-02-22 23:27:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-22 23:27:01 +0100 |
| commit | 763b8c6579f3ae571f7287c72b9fb4f8b6e89349 (patch) | |
| tree | bc55a0e79107a93bc3e605a0cae32926dc4c52fc /src/playlist.rs | |
| parent | 2792ba9c8a7120a91b3bd2c6075e737690e73405 (diff) | |
| parent | 326cfa543c6263818aad7dec4a869bc8139ec14c (diff) | |
| download | pokebot-763b8c6579f3ae571f7287c72b9fb4f8b6e89349.tar.gz pokebot-763b8c6579f3ae571f7287c72b9fb4f8b6e89349.zip | |
Merge pull request #33 from Mavulp/webserver
Webserver
Diffstat (limited to 'src/playlist.rs')
| -rw-r--r-- | src/playlist.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/playlist.rs b/src/playlist.rs index 87c1c98..445f8a5 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -28,6 +28,16 @@ impl Playlist { res } + pub fn to_vec(&self) -> Vec<AudioMetadata> { + let (a, b) = self.data.as_slices(); + + let mut res = a.to_vec(); + res.extend_from_slice(b); + res.reverse(); + + res + } + pub fn is_empty(&self) -> bool { self.data.is_empty() } |
