cargo fmt/clippy all the things + make them mandatory in CI

This commit is contained in:
Henrik Friedrichsen
2019-04-03 14:13:40 +02:00
parent 25fbdb8bde
commit 1c26c7bcee
9 changed files with 86 additions and 82 deletions

View File

@@ -14,7 +14,7 @@ pub struct Artist {
pub id: String,
pub name: String,
pub url: String,
pub albums: Option<Vec<Album>>
pub albums: Option<Vec<Album>>,
}
impl Artist {
@@ -42,11 +42,12 @@ impl Artist {
fn tracks(&self) -> Option<Vec<&Track>> {
if let Some(albums) = self.albums.as_ref() {
Some(albums
.iter()
.map(|a| a.tracks.as_ref().unwrap())
.flatten()
.collect()
Some(
albums
.iter()
.map(|a| a.tracks.as_ref().unwrap())
.flatten()
.collect(),
)
} else {
None
@@ -60,7 +61,7 @@ impl From<&FullArtist> for Artist {
id: fa.id.clone(),
name: fa.name.clone(),
url: fa.uri.clone(),
albums: None
albums: None,
}
}
}