Implement PairedQueue
Didn't have time tonight to get int priorities working in some cases
This commit is contained in:
parent
494168597e
commit
7b74ab3687
2 changed files with 94 additions and 7 deletions
|
@ -10,12 +10,12 @@ pub struct Item<D: Clone, P: PartialOrd + Clone> {
|
|||
|
||||
impl<D: Clone, P: PartialOrd + Clone> Item<D, P> {
|
||||
/// Creates a new instance
|
||||
fn new(data: D, priority: P) -> Self {
|
||||
pub fn new(data: D, priority: P) -> Self {
|
||||
Self { data, priority }
|
||||
}
|
||||
|
||||
/// Retrieve the internal data, it would be nicer to implement this using [`From`] or [`Into`], but I don't see a way to do that using generics
|
||||
fn data(self) -> D {
|
||||
pub fn data(self) -> D {
|
||||
self.data
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue