Skip to content

Instantly share code, notes, and snippets.

@Gisleburt
Last active June 10, 2019 12:26
Show Gist options
  • Save Gisleburt/9fc00a6d35941b04a1f4d1edd2df41c4 to your computer and use it in GitHub Desktop.
Save Gisleburt/9fc00a6d35941b04a1f4d1edd2df41c4 to your computer and use it in GitHub Desktop.
impl<'a> fmt::Display for Albums<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.0.iter().fold(Ok(()), |result, album| {
result.and_then(|_| writeln!(f, "{}", album))
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment