Correction des warnings de compilation (dead_code)
b38040b parent: ccd9183 modified
src/config/playlist.rs +1 -0 | @@ -41,6 +41,7 @@ impl Playlist { | ||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /// Creates a new playlist with the given name and feed IDs |
| 44 | + #[allow(dead_code)] | |
| 44 | 45 | pub fn with_feeds(name: impl Into<String>, feed_ids: Vec<String>) -> Self { |
| 45 | 46 | Self { |
| 46 | 47 | id: Uuid::new_v4().to_string(), |
| @@ -41,6 +41,7 @@ impl Playlist { | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | /// Creates a new playlist with the given name and feed IDs | 43 | /// Creates a new playlist with the given name and feed IDs |
| 44 | + #[allow(dead_code)] | ||
| 44 | pub fn with_feeds(name: impl Into<String>, feed_ids: Vec<String>) -> Self { | 45 | pub fn with_feeds(name: impl Into<String>, feed_ids: Vec<String>) -> Self { |
| 45 | Self { | 46 | Self { |
| 46 | id: Uuid::new_v4().to_string(), | 47 | id: Uuid::new_v4().to_string(), |
modified
src/ui/notifications.rs +4 -0 | @@ -27,6 +27,7 @@ pub enum NotificationType { | ||
| 27 | 27 | /// Success message (green) |
| 28 | 28 | Success, |
| 29 | 29 | /// Warning message (yellow/orange) |
| 30 | + #[allow(dead_code)] | |
| 30 | 31 | Warning, |
| 31 | 32 | /// Error message (red) |
| 32 | 33 | Error, |
| @@ -54,6 +55,7 @@ impl Notification { | ||
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | /// Creates a new warning notification |
| 58 | + #[allow(dead_code)] | |
| 57 | 59 | pub fn warning(message: impl Into<String>) -> Self { |
| 58 | 60 | Self { |
| 59 | 61 | message: message.into(), |
| @@ -129,6 +131,7 @@ impl NotificationManager { | ||
| 129 | 131 | } |
| 130 | 132 | |
| 131 | 133 | /// Adds a warning notification |
| 134 | + #[allow(dead_code)] | |
| 132 | 135 | pub fn warning(&mut self, message: impl Into<String>) { |
| 133 | 136 | self.add_notification(Notification::warning(message)); |
| 134 | 137 | } |
| @@ -149,6 +152,7 @@ impl NotificationManager { | ||
| 149 | 152 | } |
| 150 | 153 | |
| 151 | 154 | /// Returns the number of active notifications |
| 155 | + #[allow(dead_code)] | |
| 152 | 156 | pub fn active_count(&self) -> usize { |
| 153 | 157 | self.notifications.iter().filter(|n| n.is_visible()).count() |
| 154 | 158 | } |
| @@ -27,6 +27,7 @@ pub enum NotificationType { | |||
| 27 | /// Success message (green) | 27 | /// Success message (green) |
| 28 | Success, | 28 | Success, |
| 29 | /// Warning message (yellow/orange) | 29 | /// Warning message (yellow/orange) |
| 30 | + #[allow(dead_code)] | ||
| 30 | Warning, | 31 | Warning, |
| 31 | /// Error message (red) | 32 | /// Error message (red) |
| 32 | Error, | 33 | Error, |
| @@ -54,6 +55,7 @@ impl Notification { | |||
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | /// Creates a new warning notification | 57 | /// Creates a new warning notification |
| 58 | + #[allow(dead_code)] | ||
| 57 | pub fn warning(message: impl Into<String>) -> Self { | 59 | pub fn warning(message: impl Into<String>) -> Self { |
| 58 | Self { | 60 | Self { |
| 59 | message: message.into(), | 61 | message: message.into(), |
| @@ -129,6 +131,7 @@ impl NotificationManager { | |||
| 129 | } | 131 | } |
| 130 | 132 | ||
| 131 | /// Adds a warning notification | 133 | /// Adds a warning notification |
| 134 | + #[allow(dead_code)] | ||
| 132 | pub fn warning(&mut self, message: impl Into<String>) { | 135 | pub fn warning(&mut self, message: impl Into<String>) { |
| 133 | self.add_notification(Notification::warning(message)); | 136 | self.add_notification(Notification::warning(message)); |
| 134 | } | 137 | } |
| @@ -149,6 +152,7 @@ impl NotificationManager { | |||
| 149 | } | 152 | } |
| 150 | 153 | ||
| 151 | /// Returns the number of active notifications | 154 | /// Returns the number of active notifications |
| 155 | + #[allow(dead_code)] | ||
| 152 | pub fn active_count(&self) -> usize { | 156 | pub fn active_count(&self) -> usize { |
| 153 | self.notifications.iter().filter(|n| n.is_visible()).count() | 157 | self.notifications.iter().filter(|n| n.is_visible()).count() |
| 154 | } | 158 | } |