Implement PairedQueue

Didn't have time tonight to get int priorities working in some cases
This commit is contained in:
Michael Bradley 2025-01-09 23:01:59 +13:00
parent 494168597e
commit 7b74ab3687
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
2 changed files with 94 additions and 7 deletions

View file

@ -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
}
}