ArrayMapFacade could implement this:
impl<K,V,R,B,constN:usize>TryFrom<[(K,V);N]>forArrayMapFacade<K,V,R,B>whereK:Eq + Hash,R:RawTable<(K,V)> + Default,B:BuildHasher + Default,{typeError = CapacityError;fntry_from(value:[(K,V);N]) -> Result<Self,Self::Error>{letmut result = Self::with_build_hasher(B::default());for(key, value)in value {
result.insert(key, value)?;}Ok(result)}}but it conflicts with the "specialized" implementation for FixedSizeTables:
| impl<K,V,R,B,constN:usize>From<[(K,V);N]>forArrayMapFacade<K,V,R,B> |
| where |
| K:Eq + Hash, |
| R:FixedSizeTable<(K,V),N> + Default, |
| B:BuildHasher + Default, |
| { |
| fnfrom(value:[(K,V);N]) -> Self{ |
| letmut result = Self::with_build_hasher(B::default()); |
| |
| for(key, value)in value { |
| ifletErr(error) = result.insert(key, value){ |
| unreachable_unchecked!(error); |
| } |
| } |
| |
| result |
| } |
| } |
ArrayMapFacadecould implement this:but it conflicts with the "specialized" implementation for
FixedSizeTables:array-map/src/array_map.rs
Lines 1064 to 1081 in 4390c72