Skip to content

Commit 981cdf9

Browse files
committed
Remove has_std for IndexMap::from(array) and IndexSet::from(array)
1 parent a95d7dc commit 981cdf9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ where
13421342
}
13431343
}
13441344

1345-
#[cfg(all(has_std, rustc_1_51))]
1345+
#[cfg(all(rustc_1_51))]
13461346
impl<K, V, const N: usize> From<[(K, V); N]> for IndexMap<K, V, RandomState>
13471347
where
13481348
K: Hash + Eq,
@@ -1357,7 +1357,7 @@ where
13571357
/// assert_eq!(map1, map2);
13581358
/// ```
13591359
fn from(arr: [(K, V); N]) -> Self {
1360-
std::array::IntoIter::new(arr).collect()
1360+
::core::array::IntoIter::new(arr).collect()
13611361
}
13621362
}
13631363

@@ -1857,7 +1857,7 @@ mod tests {
18571857
}
18581858

18591859
#[test]
1860-
#[cfg(all(has_std, rustc_1_51))]
1860+
#[cfg(all(rustc_1_51))]
18611861
fn from_array() {
18621862
let map = IndexMap::from([(1, 2), (3, 4)]);
18631863
let mut expected = IndexMap::new();

src/set.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ where
840840
}
841841
}
842842

843-
#[cfg(all(has_std, rustc_1_51))]
843+
#[cfg(all(rustc_1_51))]
844844
impl<T, const N: usize> From<[T; N]> for IndexSet<T, RandomState>
845845
where
846846
T: Eq + Hash,
@@ -855,7 +855,7 @@ where
855855
/// assert_eq!(set1, set2);
856856
/// ```
857857
fn from(arr: [T; N]) -> Self {
858-
std::array::IntoIter::new(arr).collect()
858+
::core::array::IntoIter::new(arr).collect()
859859
}
860860
}
861861

@@ -1728,7 +1728,7 @@ mod tests {
17281728
}
17291729

17301730
#[test]
1731-
#[cfg(all(has_std, rustc_1_51))]
1731+
#[cfg(all(rustc_1_51))]
17321732
fn from_array() {
17331733
let set1 = IndexSet::from([1, 2, 3, 4]);
17341734
let set2: IndexSet<_> = [1, 2, 3, 4].into();

0 commit comments

Comments
 (0)