diff --git a/src/lyrics.rs b/src/lyrics.rs index acb5a90..89576c4 100644 --- a/src/lyrics.rs +++ b/src/lyrics.rs @@ -66,17 +66,15 @@ pub async fn lyrics(info: web::Query) -> Result { } fn get_song_id(document: &Html) -> crate::Result { - let meta = document + Ok(document .select(&SONG_ID_SELECTOR) .next() - .ok_or("Failed to find meta tag with song ID")?; - let id = meta + .ok_or("Failed to find meta tag with song ID")? .value() .attr("content") .and_then(|content| content.strip_prefix("genius://songs/")) .ok_or("Failed to find content attribute")? - .parse::()?; - Ok(id) + .parse::()?) } fn scrape_lyrics(document: &Html) -> Vec {