Skip to content

Commit

Permalink
Use inherent primitive items
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Mar 24, 2024
1 parent 1900fae commit 9d33569
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
3 changes: 1 addition & 2 deletions src/iter/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ fn execute_unindexed_range() {

#[test]
fn execute_pseudo_indexed_range() {
use std::i128::MAX;
let range = MAX - 1024..MAX;
let range = i128::MAX - 1024..i128::MAX;

// Given `Some` length, collecting `Vec` will try to act indexed.
let a = range.clone().into_par_iter();
Expand Down
7 changes: 0 additions & 7 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
use crate::iter::plumbing::*;
use crate::iter::*;
use std::char;
use std::ops::Range;
use std::usize;

/// Parallel iterator over a range, implemented for all integer types and `char`.
///
Expand Down Expand Up @@ -378,8 +376,6 @@ fn check_range_split_at_overflow() {

#[test]
fn test_i128_len_doesnt_overflow() {
use std::{i128, u128};

// Using parse because some versions of rust don't allow long literals
let octillion: i128 = "1000000000000000000000000000".parse().unwrap();
let producer = IterProducer {
Expand All @@ -395,7 +391,6 @@ fn test_i128_len_doesnt_overflow() {

#[test]
fn test_u64_opt_len() {
use std::{u64, usize};
assert_eq!(Some(100), (0..100u64).into_par_iter().opt_len());
assert_eq!(
Some(usize::MAX),
Expand All @@ -414,7 +409,6 @@ fn test_u64_opt_len() {

#[test]
fn test_u128_opt_len() {
use std::{u128, usize};
assert_eq!(Some(100), (0..100u128).into_par_iter().opt_len());
assert_eq!(
Some(usize::MAX),
Expand All @@ -430,7 +424,6 @@ fn test_u128_opt_len() {
#[cfg(target_pointer_width = "64")]
fn test_usize_i64_overflow() {
use crate::ThreadPoolBuilder;
use std::i64;

let iter = (-2..i64::MAX).into_par_iter();
assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 2));
Expand Down
5 changes: 0 additions & 5 deletions src/range_inclusive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use crate::iter::plumbing::*;
use crate::iter::*;
use std::char;
use std::ops::RangeInclusive;

/// Parallel iterator over an inclusive range, implemented for all integer types and `char`.
Expand Down Expand Up @@ -313,7 +312,6 @@ impl IndexedParallelIterator for Iter<char> {
#[test]
#[cfg(target_pointer_width = "64")]
fn test_u32_opt_len() {
use std::u32;
assert_eq!(Some(101), (0..=100u32).into_par_iter().opt_len());
assert_eq!(
Some(u32::MAX as usize),
Expand All @@ -327,7 +325,6 @@ fn test_u32_opt_len() {

#[test]
fn test_u64_opt_len() {
use std::{u64, usize};
assert_eq!(Some(101), (0..=100u64).into_par_iter().opt_len());
assert_eq!(
Some(usize::MAX),
Expand All @@ -339,7 +336,6 @@ fn test_u64_opt_len() {

#[test]
fn test_u128_opt_len() {
use std::{u128, usize};
assert_eq!(Some(101), (0..=100u128).into_par_iter().opt_len());
assert_eq!(
Some(usize::MAX),
Expand All @@ -355,7 +351,6 @@ fn test_u128_opt_len() {
#[cfg(target_pointer_width = "64")]
fn test_usize_i64_overflow() {
use crate::ThreadPoolBuilder;
use std::i64;

let iter = (-2..=i64::MAX).into_par_iter();
assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 3));
Expand Down
1 change: 0 additions & 1 deletion tests/chars.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use rayon::prelude::*;
use std::char;

#[test]
fn half_open_correctness() {
Expand Down

0 comments on commit 9d33569

Please sign in to comment.