rusty_structures/priority_queue/
pair.rs

1use std::fmt::Display;
2
3#[derive(Clone, Copy, Debug)]
4pub struct Pair<T> where T : Clone + Sized + Display + PartialEq {
5    pub priority: usize,
6    pub element: T
7}
8
9impl<T: Clone + Display + PartialEq> Display for Pair<T> {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        write!(f, "priority: {}, element: {}", self.priority, self.element)
12    }
13}