split this into its own function
Some checks failed
/ clippy (push) Successful in 6m25s
/ test (push) Failing after 12m51s

This commit is contained in:
Chris Cochrun 2026-02-23 15:18:38 -06:00
parent 57d0380ca3
commit cf691a2de2

View file

@ -131,23 +131,28 @@ mod test {
song.author == "North Point InsideOut"
}) {
assert_eq!(&song, first);
let song = Song::from(song);
if let Some(verse_map) = song.verse_map.as_ref() {
if verse_map.len() < 2 {
return Err(format!(
"VerseMap wasn't built right likely: {:?}",
song
));
}
} else {
return Err(String::from(
"There is no VerseMap in this song",
));
};
online_song_to_song(song)?
}
Ok(())
}
fn online_song_to_song(song: OnlineSong) -> Result<(), String> {
let song = Song::from(song);
if let Some(verse_map) = song.verse_map.as_ref() {
if verse_map.len() < 2 {
return Err(format!(
"VerseMap wasn't built right likely: {:?}",
song
));
}
} else {
return Err(String::from(
"There is no VerseMap in this song",
));
};
Ok(())
}
#[tokio::test]
async fn test_online_search() {
let search =