Skip to content

Commit 1dcddda

Browse files
committed
rustfmt
1 parent 6c12c0a commit 1dcddda

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
extern crate rand;
1010

1111
mod bench;
12-
mod table;
1312
mod map;
13+
mod table;
1414

1515
pub use map::*;
1616
pub use table::{make_hash, SafeHash};

src/map.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
use self::Entry::*;
1212
use self::VacantEntryState::*;
1313

14-
use std::cell::Cell;
14+
use rand::{self, Rng};
1515
use std::borrow::Borrow;
16+
use std::cell::Cell;
1617
use std::cmp::max;
1718
use std::fmt::{self, Debug};
1819
#[allow(deprecated)]
1920
use std::hash::{BuildHasher, Hash, Hasher, SipHasher13};
2021
use std::iter::{FromIterator, FusedIterator};
2122
use std::mem::{self, replace};
2223
use std::ops::{Deref, Index};
23-
use rand::{self, Rng};
2424

25-
use super::table::{self, Bucket, EmptyBucket, FullBucket, FullBucketMut, RawTable, SafeHash};
2625
use super::table::BucketState::{Empty, Full};
26+
use super::table::{self, Bucket, EmptyBucket, FullBucket, FullBucketMut, RawTable, SafeHash};
2727

2828
const MIN_NONZERO_RAW_CAPACITY: usize = 32; // must be a power of two
2929

@@ -812,7 +812,8 @@ where
812812
pub fn reserve(&mut self, additional: usize) {
813813
let remaining = self.capacity() - self.len(); // this can't overflow
814814
if remaining < additional {
815-
let min_cap = self.len()
815+
let min_cap = self
816+
.len()
816817
.checked_add(additional)
817818
.expect("reserve overflow");
818819
let raw_cap = self.resize_policy.raw_capacity(min_cap);
@@ -2663,11 +2664,11 @@ fn assert_covariance() {
26632664

26642665
#[cfg(test)]
26652666
mod test_map {
2666-
use super::HashMap;
26672667
use super::Entry::{Occupied, Vacant};
2668+
use super::HashMap;
26682669
use super::RandomState;
2669-
use std::cell::RefCell;
26702670
use rand::{thread_rng, Rng};
2671+
use std::cell::RefCell;
26712672

26722673
#[test]
26732674
fn test_zero_capacities() {
@@ -3595,7 +3596,6 @@ mod test_map {
35953596
panic!("Adaptive early resize failed");
35963597
}
35973598

3598-
35993599
#[test]
36003600
fn test_remove_at_index() {
36013601
let mut m = HashMap::new();

0 commit comments

Comments
 (0)