Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove rand as a public dependency + rollup and other cleanups #265

Merged
merged 8 commits into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
include:
- build: pinned
os: ubuntu-18.04
rust: 1.34.0
rust: 1.46.0
- build: stable
os: ubuntu-18.04
rust: stable
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ regex = ["env_logger/regex"]
name = "quickcheck"

[dependencies]
env_logger = { version = "0.7.0", default-features = false, optional = true }
env_logger = { version = "0.8.2", default-features = false, optional = true }
log = { version = "0.4", optional = true }
rand = "0.7"
rand_core = "0.5"
rand = { version = "0.8", default-features = false, features = ["small_rng", "std"] }
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ default and thus no longer available.

### Minimum Rust version policy

This crate's minimum supported `rustc` version is `1.34.0`.
This crate's minimum supported `rustc` version is `1.46.0`.

The current policy is that the minimum Rust version required to use this crate
can be increased in minor version updates. For example, if `crate 1.0` requires
Expand Down Expand Up @@ -195,7 +195,7 @@ trait. Great, so what is this `Testable` business?

```rust
pub trait Testable {
fn result<G: Gen>(&self, &mut G) -> TestResult;
fn result(&self, &mut Gen) -> TestResult;
}
```

Expand All @@ -207,7 +207,7 @@ Sure enough, `bool` satisfies the `Testable` trait:

```rust
impl Testable for bool {
fn result<G: Gen>(&self, _: &mut G) -> TestResult {
fn result(&self, _: &mut Gen) -> TestResult {
TestResult::from_bool(*self)
}
}
Expand All @@ -218,7 +218,7 @@ satisfy `Testable` too!

```rust
impl<A: Arbitrary + Debug, B: Testable> Testable for fn(A) -> B {
fn result<G: Gen>(&self, g: &mut G) -> TestResult {
fn result(&self, g: &mut Gen) -> TestResult {
// elided
}
}
Expand All @@ -236,7 +236,7 @@ make sure `TestResult` satisfies `Testable`:

```rust
impl Testable for TestResult {
fn result<G: Gen>(&self, _: &mut G) -> TestResult { self.clone() }
fn result(&self, _: &mut Gen) -> TestResult { self.clone() }
}
```

Expand Down Expand Up @@ -406,7 +406,7 @@ the trait `Arbitrary` for the struct `Point`:
use quickcheck::{Arbitrary, Gen};

impl Arbitrary for Point {
fn arbitrary<G: Gen>(g: &mut G) -> Point {
fn arbitrary(g: &mut Gen) -> Point {
Point {
x: i32::arbitrary(g),
y: i32::arbitrary(g),
Expand Down
6 changes: 3 additions & 3 deletions examples/btree_set_range.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};
use std::collections::BTreeSet;
use std::ops::Bound::{self, *};

use quickcheck::{quickcheck, TestResult};

/// Covers every `std::ops::Range*` plus variants with exclusive start.
type RangeAny<T> = (Bound<T>, Bound<T>);

/// Mimic `RangeBounds::contains`, stabilized in Rust 1.35.
trait RangeBounds<T> {
fn contains(&self, _: &T) -> bool;
}

impl<T: PartialOrd> RangeBounds<T> for RangeAny<T> {
fn contains(&self, item: &T) -> bool {
(match &self.0 {
Expand Down
2 changes: 0 additions & 2 deletions examples/out_of_bounds.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions examples/reverse.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate quickcheck;

use quickcheck::quickcheck;

fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
Expand Down
2 changes: 0 additions & 2 deletions examples/reverse_single.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};

fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
Expand Down
2 changes: 0 additions & 2 deletions examples/sieve.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate quickcheck;

use quickcheck::quickcheck;

fn sieve(n: usize) -> Vec<usize> {
Expand Down
6 changes: 2 additions & 4 deletions examples/sort.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
// This is a buggy quick sort implementation, QuickCheck will find the bug for
// you.

extern crate quickcheck;

use quickcheck::quickcheck;

fn smaller_than<T: Clone + Ord>(xs: &[T], pivot: &T) -> Vec<T> {
return xs.iter().filter(|&x| *x < *pivot).map(|x| x.clone()).collect();
xs.iter().filter(|&x| *x < *pivot).map(|x| x.clone()).collect()
}

fn larger_than<T: Clone + Ord>(xs: &[T], pivot: &T) -> Vec<T> {
return xs.iter().filter(|&x| *x > *pivot).map(|x| x.clone()).collect();
xs.iter().filter(|&x| *x > *pivot).map(|x| x.clone()).collect()
}

fn sortk<T: Clone + Ord>(x: &T, xs: &[T]) -> Vec<T> {
Expand Down
1 change: 1 addition & 0 deletions quickcheck_macros/COPYING
1 change: 1 addition & 0 deletions quickcheck_macros/LICENSE-MIT
1 change: 1 addition & 0 deletions quickcheck_macros/UNLICENSE
Loading