Fixed warnings from cargo

This commit is contained in:
2024-09-19 19:12:07 +03:00
parent 6e70d38f7f
commit 33ca4502e4
8 changed files with 54 additions and 78 deletions

View File

@@ -13,8 +13,6 @@ use serde::{Deserialize, Serialize};
const DEFAULT_MANIFEST: &'static str = include_str!("../../manifest.default.json");
pub type SongName = String;
pub type Genre = HashMap<SongName, song::Song>;
#[allow(non_camel_case_types)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -43,7 +41,7 @@ impl Manifest {
pub fn get_format(&self) -> &Format {
&self.format
}
pub fn add_song(&mut self, playlist_name: &String, name: SongName, song: Song) -> Option<Song> {
pub fn add_song(&mut self, playlist_name: &String, name: String, song: Song) -> Option<Song> {
self.get_playlist_mut(playlist_name)?.add_song(name, song)
}
pub fn get_song(&self, playlist_name: &String, name: &String) -> Option<&Song> {

View File

@@ -13,9 +13,6 @@ pub struct Playlist {
impl Playlist {
pub fn new() -> Self {
Self { ..Default::default() }
}
pub fn add_song(&mut self, name: String, song: Song) -> Option<Song> {
self.songs.insert(name, song)
@@ -32,7 +29,8 @@ impl Playlist {
pub fn get_songs(&self) -> &HashMap<String, Song> {
&self.songs
}
#[allow(dead_code)]
pub fn get_songs_mut(&mut self) -> &mut HashMap<String, Song> {
&mut self.songs
}