@@ -360,25 +360,16 @@ where
360360/// println!("{}: \"{}\"", book, review);
361361/// }
362362/// ```
363- pub struct IndexMap < K , V , S , const N : usize >
364- where
365- K : Eq + Hash ,
366- {
363+ pub struct IndexMap < K , V , S , const N : usize > {
367364 core : CoreMap < K , V , N > ,
368365 build_hasher : S ,
369366}
370367
371- impl < K , V , S , const N : usize > IndexMap < K , V , BuildHasherDefault < S > , N >
372- where
373- K : Eq + Hash ,
374- S : Default + Hasher ,
375- {
368+ impl < K , V , S , const N : usize > IndexMap < K , V , BuildHasherDefault < S > , N > {
376369 /// Creates an empty `IndexMap`.
377- ///
378- /// **NOTE** This constructor will become a `const fn` in the future
379- pub fn new ( ) -> Self {
370+ pub const fn new ( ) -> Self {
380371 IndexMap {
381- build_hasher : BuildHasherDefault :: default ( ) ,
372+ build_hasher : BuildHasherDefault :: new ( ) ,
382373 core : CoreMap :: new ( ) ,
383374 }
384375 }
@@ -737,7 +728,6 @@ where
737728 K : Eq + Hash + Borrow < Q > ,
738729 Q : ?Sized + Eq + Hash ,
739730 S : BuildHasher ,
740- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
741731{
742732 type Output = V ;
743733
@@ -751,7 +741,6 @@ where
751741 K : Eq + Hash + Borrow < Q > ,
752742 Q : ?Sized + Eq + Hash ,
753743 S : BuildHasher ,
754- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
755744{
756745 fn index_mut ( & mut self , key : & Q ) -> & mut V {
757746 self . get_mut ( key) . expect ( "key not found" )
@@ -763,7 +752,6 @@ where
763752 K : Eq + Hash + Clone ,
764753 V : Clone ,
765754 S : Clone ,
766- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
767755{
768756 fn clone ( & self ) -> Self {
769757 Self {
@@ -778,7 +766,6 @@ where
778766 K : Eq + Hash + fmt:: Debug ,
779767 V : fmt:: Debug ,
780768 S : BuildHasher ,
781- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
782769{
783770 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
784771 f. debug_map ( ) . entries ( self . iter ( ) ) . finish ( )
@@ -789,7 +776,6 @@ impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>
789776where
790777 K : Eq + Hash ,
791778 S : BuildHasher + Default ,
792- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
793779{
794780 fn default ( ) -> Self {
795781 IndexMap {
0 commit comments