diff --git a/proptest/src/collection.rs b/proptest/src/collection.rs index 91f7b286..8ecb0584 100644 --- a/proptest/src/collection.rs +++ b/proptest/src/collection.rs @@ -165,18 +165,9 @@ impl From> for SizeRange { } } -#[cfg(feature = "frunk")] -impl Generic for SizeRange { - type Repr = RangeInclusive; - - /// Converts the `SizeRange` into `Range`. - fn into(self) -> Self::Repr { - self.0 - } - - /// Converts `RangeInclusive` into `SizeRange`. - fn from(r: Self::Repr) -> Self { - r.into() +impl From for Range { + fn from(size_range: SizeRange) -> Self { + size_range.0 } } diff --git a/proptest/src/lib.rs b/proptest/src/lib.rs index db48b6ee..980b8a6e 100644 --- a/proptest/src/lib.rs +++ b/proptest/src/lib.rs @@ -42,15 +42,6 @@ extern crate std; #[macro_use] extern crate alloc; -#[cfg(feature = "frunk")] -#[macro_use] -extern crate frunk_core; - -#[cfg(feature = "frunk")] -#[macro_use] -mod product_frunk; - -#[cfg(not(feature = "frunk"))] #[macro_use] mod product_tuple; diff --git a/proptest/src/option.rs b/proptest/src/option.rs index 53b8d270..bcf1124a 100644 --- a/proptest/src/option.rs +++ b/proptest/src/option.rs @@ -40,17 +40,6 @@ impl Default for Probability { } } -impl From for Probability { - /// Creates a `Probability` from a `f64`. - /// - /// # Panics - /// - /// Panics if the probability is outside interval `[0.0, 1.0]`. - fn from(prob: f64) -> Self { - Probability::new(prob) - } -} - impl Probability { /// Creates a `Probability` from a `f64`. /// @@ -81,25 +70,14 @@ impl Probability { } } -#[cfg(feature = "frunk")] -use frunk_core::generic::Generic; - -#[cfg(feature = "frunk")] -impl Generic for Probability { - type Repr = f64; - - /// Converts the `Probability` into an `f64`. - fn into(self) -> Self::Repr { - self.0 - } - +impl From for Probability { /// Creates a `Probability` from a `f64`. /// /// # Panics /// /// Panics if the probability is outside interval `[0.0, 1.0]`. - fn from(r: Self::Repr) -> Self { - r.into() + fn from(prob: f64) -> Self { + Probability::new(prob) } } diff --git a/proptest/src/product_frunk.rs b/proptest/src/product_frunk.rs deleted file mode 100644 index b12524d1..00000000 --- a/proptest/src/product_frunk.rs +++ /dev/null @@ -1,49 +0,0 @@ -//- -// Copyright 2017, 2018 The proptest developers -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Defines macros for product type creation, extraction, and the type signature -//! itself. This version uses `frunk_core`. This mechanism is used to be very -//! loosely coupled with `frunk_core` so that only `lib.rs` has to be changed -//! in the event that Rust gets tuple-variadic generics. - -macro_rules! product_type { - ($factor: ty) => { - Hlist![$factor] - }; - ($($factor: ty),*) => { - Hlist![$( $factor, )*] - }; - ($($factor: ty),*,) => { - Hlist![$( $factor, )*] - }; -} - -macro_rules! product_pack { - ($factor: expr) => { - hlist![$factor] - }; - ($($factor: expr),*) => { - hlist![$( $factor ),*] - }; - ($($factor: expr),*,) => { - hlist![$( $factor ),*] - }; -} - -macro_rules! product_unpack { - ($factor: pat) => { - hlist_pat![$factor] - }; - ($($factor: pat),*) => { - hlist_pat![$( $factor ),*] - }; - ($($factor: pat),*,) => { - hlist_pat![$( $factor ),*] - }; -} diff --git a/proptest/src/product_tuple.rs b/proptest/src/product_tuple.rs index 1c32d954..62a15f10 100644 --- a/proptest/src/product_tuple.rs +++ b/proptest/src/product_tuple.rs @@ -8,9 +8,7 @@ // except according to those terms. //! Defines macros for product type creation, extraction, and the type signature -//! itself. This version uses tuples. This mechanism is used to be very -//! loosely coupled with `frunk_core` so that only `lib.rs` has to be changed -//! in the event that Rust gets tuple-variadic generics. +//! itself. This version uses tuples. macro_rules! product_type { ($factor: ty) => {