about summary refs log tree commit diff stats
path: root/src/watch/events/playlist_handler.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-25 17:30:02 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-25 17:30:02 +0200
commita60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411 (patch)
tree24dc96e5384cf9309ae4ec00d6d91497e3253484 /src/watch/events/playlist_handler.rs
parentdocs(yt_dlp/progress_hook): Add a note about the possibility to calculate vid... (diff)
downloadyt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.tar.gz
yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.zip
refactor(treewide): Conform to `cargo clippy`
Diffstat (limited to 'src/watch/events/playlist_handler.rs')
-rw-r--r--src/watch/events/playlist_handler.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/watch/events/playlist_handler.rs b/src/watch/events/playlist_handler.rs
index 8f2f322..0933856 100644
--- a/src/watch/events/playlist_handler.rs
+++ b/src/watch/events/playlist_handler.rs
@@ -86,9 +86,7 @@ impl PlaylistHandler {
         }
 
         for (id, hash) in playlist {
-            if !self.playlist_ids.contains_key(&id) {
-                self.playlist_ids.insert(id, hash);
-            }
+            self.playlist_ids.entry(id).or_insert(hash);
         }
 
         Ok(&self.playlist_ids)