@@ -53,7 +53,7 @@ impl<V> EntityIndexMap<V> {
53
53
54
54
/// Constructs an `EntityIndexMap` from an [`IndexMap`].
55
55
#[ inline]
56
- pub fn from_index_map ( set : IndexMap < Entity , V , EntityHash > ) -> Self {
56
+ pub const fn from_index_map ( set : IndexMap < Entity , V , EntityHash > ) -> Self {
57
57
Self ( set)
58
58
}
59
59
@@ -482,7 +482,7 @@ impl<V> Slice<V> {
482
482
reason = "We wish to access the Box API of the inner type, without consuming it."
483
483
) ]
484
484
#[ inline]
485
- pub fn as_boxed_inner ( self : & Box < Self > ) -> & Box < map:: Slice < Entity , V > > {
485
+ pub const fn as_boxed_inner ( self : & Box < Self > ) -> & Box < map:: Slice < Entity , V > > {
486
486
// SAFETY: Slice is a transparent wrapper around indexmap::map::Slice.
487
487
unsafe { & * ( ptr:: from_ref ( self ) . cast :: < Box < map:: Slice < Entity , V > > > ( ) ) }
488
488
}
@@ -943,13 +943,13 @@ impl<'a, V> Iter<'a, V> {
943
943
/// `iter` must either be empty, or have been obtained from a
944
944
/// [`IndexMap`] using the `S` hasher.
945
945
#[ inline]
946
- pub unsafe fn from_iter_unchecked < S > ( iter : map:: Iter < ' a , Entity , V > ) -> Iter < ' a , V , S > {
946
+ pub const unsafe fn from_iter_unchecked < S > ( iter : map:: Iter < ' a , Entity , V > ) -> Iter < ' a , V , S > {
947
947
Iter :: < ' _ , _ , S > ( iter, PhantomData )
948
948
}
949
949
950
950
/// Returns the inner [`Iter`](map::Iter).
951
951
#[ inline]
952
- pub fn into_inner ( self ) -> map:: Iter < ' a , Entity , V > {
952
+ pub const fn into_inner ( self ) -> map:: Iter < ' a , Entity , V > {
953
953
self . 0
954
954
}
955
955
@@ -1028,15 +1028,15 @@ impl<'a, V> IterMut<'a, V> {
1028
1028
/// `iter_mut` must either be empty, or have been obtained from a
1029
1029
/// [`IndexMap`] using the `S` hasher.
1030
1030
#[ inline]
1031
- pub unsafe fn from_iter_mut_unchecked < S > (
1031
+ pub const unsafe fn from_iter_mut_unchecked < S > (
1032
1032
iter_mut : map:: IterMut < ' a , Entity , V > ,
1033
1033
) -> IterMut < ' a , V , S > {
1034
1034
IterMut :: < ' _ , _ , S > ( iter_mut, PhantomData )
1035
1035
}
1036
1036
1037
1037
/// Returns the inner [`IterMut`](map::IterMut).
1038
1038
#[ inline]
1039
- pub fn into_inner ( self ) -> map:: IterMut < ' a , Entity , V > {
1039
+ pub const fn into_inner ( self ) -> map:: IterMut < ' a , Entity , V > {
1040
1040
self . 0
1041
1041
}
1042
1042
@@ -1119,7 +1119,7 @@ impl<V> IntoIter<V> {
1119
1119
/// `into_iter` must either be empty, or have been obtained from a
1120
1120
/// [`IndexMap`] using the `S` hasher.
1121
1121
#[ inline]
1122
- pub unsafe fn from_into_iter_unchecked < S > (
1122
+ pub const unsafe fn from_into_iter_unchecked < S > (
1123
1123
into_iter : map:: IntoIter < Entity , V > ,
1124
1124
) -> IntoIter < V , S > {
1125
1125
IntoIter :: < _ , S > ( into_iter, PhantomData )
@@ -1218,7 +1218,9 @@ impl<'a, V> Drain<'a, V> {
1218
1218
/// `drain` must either be empty, or have been obtained from a
1219
1219
/// [`IndexMap`] using the `S` hasher.
1220
1220
#[ inline]
1221
- pub unsafe fn from_drain_unchecked < S > ( drain : map:: Drain < ' a , Entity , V > ) -> Drain < ' a , V , S > {
1221
+ pub const unsafe fn from_drain_unchecked < S > (
1222
+ drain : map:: Drain < ' a , Entity , V > ,
1223
+ ) -> Drain < ' a , V , S > {
1222
1224
Drain :: < ' _ , _ , S > ( drain, PhantomData )
1223
1225
}
1224
1226
@@ -1290,13 +1292,13 @@ impl<'a, V> Keys<'a, V> {
1290
1292
/// `keys` must either be empty, or have been obtained from a
1291
1293
/// [`IndexMap`] using the `S` hasher.
1292
1294
#[ inline]
1293
- pub unsafe fn from_keys_unchecked < S > ( keys : map:: Keys < ' a , Entity , V > ) -> Keys < ' a , V , S > {
1295
+ pub const unsafe fn from_keys_unchecked < S > ( keys : map:: Keys < ' a , Entity , V > ) -> Keys < ' a , V , S > {
1294
1296
Keys :: < ' _ , _ , S > ( keys, PhantomData )
1295
1297
}
1296
1298
1297
1299
/// Returns the inner [`Keys`](map::Keys).
1298
1300
#[ inline]
1299
- pub fn into_inner ( self ) -> map:: Keys < ' a , Entity , V > {
1301
+ pub const fn into_inner ( self ) -> map:: Keys < ' a , Entity , V > {
1300
1302
self . 0
1301
1303
}
1302
1304
}
@@ -1378,7 +1380,7 @@ impl<V> IntoKeys<V> {
1378
1380
/// `into_keys` must either be empty, or have been obtained from a
1379
1381
/// [`IndexMap`] using the `S` hasher.
1380
1382
#[ inline]
1381
- pub unsafe fn from_into_keys_unchecked < S > (
1383
+ pub const unsafe fn from_into_keys_unchecked < S > (
1382
1384
into_keys : map:: IntoKeys < Entity , V > ,
1383
1385
) -> IntoKeys < V , S > {
1384
1386
IntoKeys :: < _ , S > ( into_keys, PhantomData )
0 commit comments