@@ -361,24 +361,17 @@ where
361361/// }
362362/// ```
363363pub struct IndexMap < K , V , S , const N : usize >
364- where
365- K : Eq + Hash ,
366364{
367365 core : CoreMap < K , V , N > ,
368366 build_hasher : S ,
369367}
370368
371369impl < K , V , S , const N : usize > IndexMap < K , V , BuildHasherDefault < S > , N >
372- where
373- K : Eq + Hash ,
374- S : Default + Hasher ,
375370{
376371 /// Creates an empty `IndexMap`.
377- ///
378- /// **NOTE** This constructor will become a `const fn` in the future
379- pub fn new ( ) -> Self {
372+ pub const fn new ( ) -> Self {
380373 IndexMap {
381- build_hasher : BuildHasherDefault :: default ( ) ,
374+ build_hasher : BuildHasherDefault :: new ( ) ,
382375 core : CoreMap :: new ( ) ,
383376 }
384377 }
@@ -737,7 +730,6 @@ where
737730 K : Eq + Hash + Borrow < Q > ,
738731 Q : ?Sized + Eq + Hash ,
739732 S : BuildHasher ,
740- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
741733{
742734 type Output = V ;
743735
@@ -751,7 +743,6 @@ where
751743 K : Eq + Hash + Borrow < Q > ,
752744 Q : ?Sized + Eq + Hash ,
753745 S : BuildHasher ,
754- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
755746{
756747 fn index_mut ( & mut self , key : & Q ) -> & mut V {
757748 self . get_mut ( key) . expect ( "key not found" )
@@ -763,7 +754,6 @@ where
763754 K : Eq + Hash + Clone ,
764755 V : Clone ,
765756 S : Clone ,
766- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
767757{
768758 fn clone ( & self ) -> Self {
769759 Self {
@@ -778,7 +768,6 @@ where
778768 K : Eq + Hash + fmt:: Debug ,
779769 V : fmt:: Debug ,
780770 S : BuildHasher ,
781- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
782771{
783772 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
784773 f. debug_map ( ) . entries ( self . iter ( ) ) . finish ( )
@@ -789,7 +778,6 @@ impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>
789778where
790779 K : Eq + Hash ,
791780 S : BuildHasher + Default ,
792- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
793781{
794782 fn default ( ) -> Self {
795783 IndexMap {
0 commit comments