Skip to content

Instantly share code, notes, and snippets.

@ykhrustalev
Created July 15, 2018 17:51
Show Gist options
  • Save ykhrustalev/dbb12a6982fb78ff55e03fece6835b18 to your computer and use it in GitHub Desktop.
Save ykhrustalev/dbb12a6982fb78ff55e03fece6835b18 to your computer and use it in GitHub Desktop.
use std::iter::FromIterator;
impl std::fmt::Display for heap::ArrayHeap<i32> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
let x = std::vec::Vec::from_iter(self.items().iter().map(|x| x.to_string())).join(",");
std::fmt::Display::fmt(&x, f)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment