File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,10 +249,8 @@ mod parse {
249249 }
250250
251251 match & node. data {
252- NodeData :: Text { contents } => {
253- if should_parse {
254- s. push_str ( & contents. borrow ( ) . to_string ( ) ) ;
255- }
252+ NodeData :: Text { contents } if should_parse => {
253+ s. push_str ( & contents. borrow ( ) . to_string ( ) ) ;
256254 }
257255 NodeData :: Element { ref name, .. } => {
258256 if let expanded_name ! ( html "br" ) = name. expanded ( ) {
Original file line number Diff line number Diff line change @@ -121,12 +121,12 @@ fn handle_command_for_library_page(
121121 // Sort albums alphabetically
122122 data. user_data
123123 . saved_albums
124- . sort_by ( |x, y | x. name . to_lowercase ( ) . cmp ( & y . name . to_lowercase ( ) ) ) ;
124+ . sort_by_key ( |x| x. name . to_lowercase ( ) ) ;
125125
126126 // Sort artists alphabetically
127127 data. user_data
128128 . followed_artists
129- . sort_by ( |x, y | x. name . to_lowercase ( ) . cmp ( & y . name . to_lowercase ( ) ) ) ;
129+ . sort_by_key ( |x| x. name . to_lowercase ( ) ) ;
130130 }
131131
132132 if command == Command :: SortLibraryByRecent {
@@ -155,7 +155,7 @@ fn handle_command_for_library_page(
155155 // Sort albums by recent addition
156156 data. user_data
157157 . saved_albums
158- . sort_by ( |a, b| b . added_at . cmp ( & a. added_at ) ) ;
158+ . sort_by_key ( |a| std :: cmp:: Reverse ( a. added_at ) ) ;
159159 }
160160
161161 match focus_state {
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ pub fn handle_key_sequence_for_popup(
2727 ui,
2828 ) ;
2929 }
30+ // can't use match guard: the match holds an immutable borrow of ui
31+ #[ allow( clippy:: collapsible_match) ]
3032 PopupState :: UserPlaylistList ( ..) => {
3133 if handle_key_sequence_for_playlist_search_popup ( key_sequence, ui) {
3234 return Ok ( true ) ;
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ pub fn start_event_watcher(
142142 // The below refresh duration should be no less than 1s to avoid **overloading** linux dbus
143143 // handler provided by the souvlaki library, which only handles an event every 1s.
144144 // [1]: https://github.com/Sinono3/souvlaki/blob/b4d47bb2797ffdd625c17192df640510466762e1/src/platform/linux/mod.rs#L450
145- let refresh_duration = std:: time:: Duration :: from_millis ( 1000 ) ;
145+ let refresh_duration = std:: time:: Duration :: from_secs ( 1 ) ;
146146 let mut info = String :: new ( ) ;
147147 loop {
148148 update_control_metadata ( state, & mut controls, & mut info) ?;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub enum FileCacheKey {
2424
2525/// default time-to-live cache duration
2626pub static TTL_CACHE_DURATION : LazyLock < std:: time:: Duration > =
27- LazyLock :: new ( || std:: time:: Duration :: from_secs ( 60 * 60 ) ) ;
27+ LazyLock :: new ( || std:: time:: Duration :: from_hours ( 1 ) ) ;
2828
2929/// the application's data
3030pub struct AppData {
You can’t perform that action at this time.
0 commit comments