Homebrew RSS reader server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

slurp: fix clippy warnings

+9 -12
+6 -9
src/api/fever.rs
··· 77 77 } 78 78 } 79 79 80 - if params.contains_key("favicons") { 81 - if let Ok(favicons) = db::get_favicons(pool).await { 80 + if params.contains_key("favicons") 81 + && let Ok(favicons) = db::get_favicons(pool).await { 82 82 response["favicons"] = json!(favicons); 83 83 } 84 - } 85 84 86 - if params.contains_key("unread_item_ids") { 87 - if let Ok(ids) = db::get_unread_item_ids(pool).await { 85 + if params.contains_key("unread_item_ids") 86 + && let Ok(ids) = db::get_unread_item_ids(pool).await { 88 87 response["unread_item_ids"] = json!(ids); 89 88 } 90 - } 91 89 92 90 if params.contains_key("saved_item_ids") { 93 91 response["saved_item_ids"] = json!(""); ··· 98 96 body_params.get("mark"), 99 97 body_params.get("as"), 100 98 body_params.get("id"), 101 - ) { 102 - if let Ok(id) = id_str.parse::<i64>() { 99 + ) 100 + && let Ok(id) = id_str.parse::<i64>() { 103 101 match (mark.as_str(), action.as_str()) { 104 102 ("item", "read") => { 105 103 let _ = db::mark_item_read(pool, id).await; ··· 113 111 _ => {} 114 112 } 115 113 } 116 - } 117 114 118 115 Json(response) 119 116 }
+1
src/db.rs
··· 316 316 Ok(()) 317 317 } 318 318 319 + #[allow(clippy::too_many_arguments)] 319 320 pub async fn insert_item( 320 321 pool: &SqlitePool, 321 322 feed_id: i64,
+2 -3
src/fetcher.rs
··· 102 102 } 103 103 }); 104 104 105 - if let Some(url) = icon_url { 106 - if let Some(resolved) = resolve_url(&feed.url, &url) { 105 + if let Some(url) = icon_url 106 + && let Some(resolved) = resolve_url(&feed.url, &url) { 107 107 match fetch_favicon(client, &resolved).await { 108 108 Ok(data) => { 109 109 let favicon_id = db::insert_favicon(pool, &data).await?; ··· 112 112 Err(e) => warn!(feed_id = feed.id, "favicon fetch failed: {e:#}"), 113 113 } 114 114 } 115 - } 116 115 } 117 116 118 117 for entry in parsed.entries {