Skip to content

Commit cac15f6

Browse files
author
Gianmarco Garrisi
committed
Cargo fmt
1 parent 4f6aa36 commit cac15f6

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

src/store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,10 @@ mod serde {
693693
use crate::store::{Index, Position, Store};
694694

695695
use core::cmp::{Eq, Ord};
696-
#[cfg(feature = "std")]
697-
use std::collections::hash_map::RandomState;
698696
use core::hash::{BuildHasher, Hash};
699697
use core::marker::PhantomData;
698+
#[cfg(feature = "std")]
699+
use std::collections::hash_map::RandomState;
700700

701701
use serde::ser::{Serialize, SerializeSeq, Serializer};
702702

tests/double_priority_queue.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,18 +1260,19 @@ mod doublepq_tests {
12601260
mod serde_tests_basics {
12611261
use priority_queue::DoublePriorityQueue;
12621262
use serde_test::{assert_tokens, Token};
1263-
1264-
#[cfg(not(feature = "std"))]
1265-
use twox_hash::XxHash64;
1263+
12661264
#[cfg(not(feature = "std"))]
12671265
use core::hash::BuildHasherDefault;
1266+
#[cfg(not(feature = "std"))]
1267+
use twox_hash::XxHash64;
12681268

12691269
#[test]
12701270
fn serde_empty() {
12711271
#[cfg(feature = "std")]
12721272
let pq: DoublePriorityQueue<String, i32> = DoublePriorityQueue::new();
12731273
#[cfg(not(feature = "std"))]
1274-
let pq: DoublePriorityQueue<String, i32, BuildHasherDefault<XxHash64>> = DoublePriorityQueue::default();
1274+
let pq: DoublePriorityQueue<String, i32, BuildHasherDefault<XxHash64>> =
1275+
DoublePriorityQueue::default();
12751276

12761277
assert_tokens(&pq, &[Token::Seq { len: Some(0) }, Token::SeqEnd]);
12771278
}
@@ -1281,7 +1282,8 @@ mod serde_tests_basics {
12811282
#[cfg(feature = "std")]
12821283
let mut pq = DoublePriorityQueue::new();
12831284
#[cfg(not(feature = "std"))]
1284-
let mut pq: DoublePriorityQueue<&str, i32, BuildHasherDefault<XxHash64>> = DoublePriorityQueue::default();
1285+
let mut pq: DoublePriorityQueue<&str, i32, BuildHasherDefault<XxHash64>> =
1286+
DoublePriorityQueue::default();
12851287

12861288
pq.push("a", 1);
12871289
pq.push("b", 2);
@@ -1328,11 +1330,11 @@ mod serde_tests_custom_structs {
13281330
use std::default::Default;
13291331
use std::time::Duration;
13301332
use uuid::Uuid;
1331-
1332-
#[cfg(not(feature = "std"))]
1333-
use twox_hash::XxHash64;
1333+
13341334
#[cfg(not(feature = "std"))]
13351335
use core::hash::BuildHasherDefault;
1336+
#[cfg(not(feature = "std"))]
1337+
use twox_hash::XxHash64;
13361338

13371339
use serde::{Deserialize, Serialize};
13381340

@@ -1430,7 +1432,7 @@ mod serde_tests_custom_structs {
14301432
#[cfg(feature = "std")]
14311433
type PqType = DoublePriorityQueue<i32, i32>;
14321434
#[cfg(not(feature = "std"))]
1433-
type PqType = DoublePriorityQueue<i32, i32, BuildHasherDefault<XxHash64>>;
1435+
type PqType = DoublePriorityQueue<i32, i32, BuildHasherDefault<XxHash64>>;
14341436

14351437
let mut pq: PqType = DoublePriorityQueue::default();
14361438
pq.push(0, 0);
@@ -1514,7 +1516,8 @@ mod serde_tests_custom_structs {
15141516
#[cfg(feature = "std")]
15151517
type PqType = DoublePriorityQueue<ConcreteEvent1, EventComparables>;
15161518
#[cfg(not(feature = "std"))]
1517-
type PqType = DoublePriorityQueue<ConcreteEvent1, EventComparables, BuildHasherDefault<XxHash64>>;
1519+
type PqType =
1520+
DoublePriorityQueue<ConcreteEvent1, EventComparables, BuildHasherDefault<XxHash64>>;
15181521

15191522
let mut pq: PqType = DoublePriorityQueue::default();
15201523
pq.push(ce1, ec1);

tests/priority_queue.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,11 +1076,11 @@ mod pqueue_tests {
10761076
mod serde_tests_basics {
10771077
use priority_queue::PriorityQueue;
10781078
use serde_test::{assert_tokens, Token};
1079-
1080-
#[cfg(not(feature = "std"))]
1081-
use twox_hash::XxHash64;
1079+
10821080
#[cfg(not(feature = "std"))]
10831081
use core::hash::BuildHasherDefault;
1082+
#[cfg(not(feature = "std"))]
1083+
use twox_hash::XxHash64;
10841084

10851085
#[test]
10861086
fn serde_empty() {
@@ -1097,7 +1097,8 @@ mod serde_tests_basics {
10971097
#[cfg(feature = "std")]
10981098
let mut pq = PriorityQueue::new();
10991099
#[cfg(not(feature = "std"))]
1100-
let mut pq: PriorityQueue<&str, i32, BuildHasherDefault<XxHash64>> = PriorityQueue::default();
1100+
let mut pq: PriorityQueue<&str, i32, BuildHasherDefault<XxHash64>> =
1101+
PriorityQueue::default();
11011102

11021103
pq.push("a", 1);
11031104
pq.push("b", 2);
@@ -1139,16 +1140,16 @@ mod serde_tests_basics {
11391140
//thanks to ckaran
11401141
#[cfg(all(feature = "serde", test))]
11411142
mod serde_tests_custom_structs {
1142-
use priority_queue::PriorityQueue;
11431143
use core::cmp::{Ord, Ordering, PartialOrd};
11441144
use core::default::Default;
11451145
use core::time::Duration;
1146+
use priority_queue::PriorityQueue;
11461147
use uuid::Uuid;
1147-
1148-
#[cfg(not(feature = "std"))]
1149-
use twox_hash::XxHash64;
1148+
11501149
#[cfg(not(feature = "std"))]
11511150
use core::hash::BuildHasherDefault;
1151+
#[cfg(not(feature = "std"))]
1152+
use twox_hash::XxHash64;
11521153

11531154
use serde::{Deserialize, Serialize};
11541155

@@ -1246,7 +1247,7 @@ mod serde_tests_custom_structs {
12461247
#[cfg(feature = "std")]
12471248
type PqType = PriorityQueue<i32, i32>;
12481249
#[cfg(not(feature = "std"))]
1249-
type PqType = PriorityQueue<i32, i32, BuildHasherDefault<XxHash64>>;
1250+
type PqType = PriorityQueue<i32, i32, BuildHasherDefault<XxHash64>>;
12501251

12511252
let mut pq: PqType = PriorityQueue::default();
12521253
pq.push(0, 0);
@@ -1330,7 +1331,8 @@ mod serde_tests_custom_structs {
13301331
#[cfg(feature = "std")]
13311332
type PqType = PriorityQueue<ConcreteEvent1, EventComparables>;
13321333
#[cfg(not(feature = "std"))]
1333-
type PqType = PriorityQueue<ConcreteEvent1, EventComparables, BuildHasherDefault<XxHash64>>;
1334+
type PqType =
1335+
PriorityQueue<ConcreteEvent1, EventComparables, BuildHasherDefault<XxHash64>>;
13341336

13351337
let mut pq: PqType = PriorityQueue::default();
13361338
pq.push(ce1, ec1);

0 commit comments

Comments
 (0)