Skip to content

Commit 6422a96

Browse files
author
Gianmarco Garrisi
committed
Update Edition
1 parent 2338edd commit 6422a96

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
keywords = ["priority", "queue", "heap"]
1010
categories = ["data-structures", "algorithms"]
1111
license = "LGPL-3.0-or-later OR MPL-2.0"
12-
edition = "2021"
12+
edition = "2024"
1313

1414
[build-dependencies]
1515
autocfg = "1"

benches/priority_queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod benchmarks {
3333
extern crate test;
3434
use hashbrown::hash_map::DefaultHashBuilder;
3535
use priority_queue::{DoublePriorityQueue, PriorityQueue};
36-
use test::{black_box, Bencher};
36+
use test::{Bencher, black_box};
3737

3838
#[bench]
3939
fn push_and_pop(b: &mut Bencher) {

src/double_priority_queue/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ pub mod iterators;
3434
#[cfg(not(feature = "std"))]
3535
use std::vec::Vec;
3636

37+
use crate::TryReserveError;
3738
use crate::core_iterators::*;
3839
use crate::store::{Index, Position, Store};
39-
use crate::TryReserveError;
4040
use iterators::*;
4141

4242
use std::borrow::Borrow;

src/priority_queue/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ pub mod iterators;
3535
#[cfg(not(feature = "std"))]
3636
use std::vec::Vec;
3737

38+
use crate::TryReserveError;
3839
use crate::core_iterators::*;
3940
use crate::store::{Index, Position, Store};
40-
use crate::TryReserveError;
4141
use iterators::*;
4242

4343
use std::borrow::Borrow;

src/store.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use std::vec::Vec;
3030

3131
// an improvement in terms of complexity would be to use a bare HashMap
3232
// as vec instead of the IndexMap
33-
use crate::core_iterators::*;
3433
use crate::TryReserveError;
34+
use crate::core_iterators::*;
3535

3636
use std::borrow::Borrow;
3737
use std::cmp::{Eq, Ord};
@@ -302,12 +302,14 @@ impl<I, P, H> Store<I, P, H> {
302302
}
303303

304304
#[inline(always)]
305-
pub unsafe fn get_priority_from_position(&self, position: Position) -> &P { unsafe {
306-
self.map
307-
.get_index(self.heap.get_unchecked(position.0).0)
308-
.unwrap()
309-
.1
310-
}}
305+
pub unsafe fn get_priority_from_position(&self, position: Position) -> &P {
306+
unsafe {
307+
self.map
308+
.get_index(self.heap.get_unchecked(position.0).0)
309+
.unwrap()
310+
.1
311+
}
312+
}
311313
}
312314

313315
impl<I, P, H> Store<I, P, H>

tests/double_priority_queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ mod doublepq_tests {
634634
#[cfg(all(feature = "serde", test))]
635635
mod serde_tests_basics {
636636
use priority_queue::DoublePriorityQueue;
637-
use serde_test::{assert_tokens, Token};
637+
use serde_test::{Token, assert_tokens};
638638
#[test]
639639
fn serde_empty() {
640640
let pq: DoublePriorityQueue<String, i32> = DoublePriorityQueue::new();

tests/priority_queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ mod pqueue_tests {
544544
#[cfg(all(feature = "serde", test))]
545545
mod serde_tests_basics {
546546
use priority_queue::PriorityQueue;
547-
use serde_test::{assert_tokens, Token};
547+
use serde_test::{Token, assert_tokens};
548548
#[test]
549549
fn serde_empty() {
550550
let pq: PriorityQueue<String, i32> = PriorityQueue::new();

0 commit comments

Comments
 (0)