diff --git a/src/btree.rs b/src/btree.rs index 2267f2f..1761cb0 100644 --- a/src/btree.rs +++ b/src/btree.rs @@ -27,11 +27,7 @@ pub struct BiBTreeMap { right2left: BTreeMap, Ref>, } -impl BiBTreeMap -where - L: Ord, - R: Ord, -{ +impl BiBTreeMap { /// Creates an empty `BiBTreeMap`. /// /// # Examples @@ -177,7 +173,13 @@ where inner: self.right2left.iter(), } } +} +impl BiBTreeMap +where + L: Ord, + R: Ord, +{ /// Returns a reference to the right value corresponding to the given left /// value. /// @@ -610,11 +612,7 @@ where } } -impl Default for BiBTreeMap -where - L: Ord, - R: Ord, -{ +impl Default for BiBTreeMap { fn default() -> BiBTreeMap { BiBTreeMap { left2right: BTreeMap::default(), diff --git a/src/hash.rs b/src/hash.rs index c56f84c..0ce09c2 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -23,11 +23,7 @@ pub struct BiHashMap, Ref, RS>, } -impl BiHashMap -where - L: Eq + Hash, - R: Eq + Hash, -{ +impl BiHashMap { /// Creates an empty `BiHashMap`. /// /// # Examples @@ -62,11 +58,7 @@ where } } -impl BiHashMap -where - L: Eq + Hash, - R: Eq + Hash, -{ +impl BiHashMap { /// Returns the number of left-right pairs in the bimap. /// /// # Examples @@ -215,8 +207,6 @@ where impl BiHashMap where - L: Eq + Hash, - R: Eq + Hash, LS: BuildHasher, RS: BuildHasher, { @@ -266,7 +256,15 @@ where right2left: HashMap::with_capacity_and_hasher(capacity, hash_builder_right), } } +} +impl BiHashMap +where + L: Eq + Hash, + R: Eq + Hash, + LS: BuildHasher, + RS: BuildHasher, +{ /// Reserves capacity for at least `additional` more elements to be inserted /// in the `BiHashMap`. The collection may reserve more space to avoid /// frequent reallocations. @@ -699,10 +697,8 @@ where impl Default for BiHashMap where - L: Eq + Hash, - R: Eq + Hash, - LS: BuildHasher + Default, - RS: BuildHasher + Default, + LS: Default, + RS: Default, { fn default() -> BiHashMap { BiHashMap {