@@ -361,24 +361,17 @@ where
361
361
/// }
362
362
/// ```
363
363
pub struct IndexMap < K , V , S , const N : usize >
364
- where
365
- K : Eq + Hash ,
366
364
{
367
365
core : CoreMap < K , V , N > ,
368
366
build_hasher : S ,
369
367
}
370
368
371
369
impl < K , V , S , const N : usize > IndexMap < K , V , BuildHasherDefault < S > , N >
372
- where
373
- K : Eq + Hash ,
374
- S : Default + Hasher ,
375
370
{
376
371
/// 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 {
380
373
IndexMap {
381
- build_hasher : BuildHasherDefault :: default ( ) ,
374
+ build_hasher : BuildHasherDefault :: new ( ) ,
382
375
core : CoreMap :: new ( ) ,
383
376
}
384
377
}
@@ -737,7 +730,6 @@ where
737
730
K : Eq + Hash + Borrow < Q > ,
738
731
Q : ?Sized + Eq + Hash ,
739
732
S : BuildHasher ,
740
- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
741
733
{
742
734
type Output = V ;
743
735
@@ -751,7 +743,6 @@ where
751
743
K : Eq + Hash + Borrow < Q > ,
752
744
Q : ?Sized + Eq + Hash ,
753
745
S : BuildHasher ,
754
- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
755
746
{
756
747
fn index_mut ( & mut self , key : & Q ) -> & mut V {
757
748
self . get_mut ( key) . expect ( "key not found" )
@@ -763,7 +754,6 @@ where
763
754
K : Eq + Hash + Clone ,
764
755
V : Clone ,
765
756
S : Clone ,
766
- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
767
757
{
768
758
fn clone ( & self ) -> Self {
769
759
Self {
@@ -778,7 +768,6 @@ where
778
768
K : Eq + Hash + fmt:: Debug ,
779
769
V : fmt:: Debug ,
780
770
S : BuildHasher ,
781
- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
782
771
{
783
772
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
784
773
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>
789
778
where
790
779
K : Eq + Hash ,
791
780
S : BuildHasher + Default ,
792
- // N: ArrayLength<Bucket<K, V>> + ArrayLength<Option<Pos>>,
793
781
{
794
782
fn default ( ) -> Self {
795
783
IndexMap {
0 commit comments