Skip to content

Remove FnBox #7

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

Merged
merged 3 commits into from
Jul 2, 2019
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 Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datatest"
version = "0.3.2"
version = "0.3.3"
authors = ["Ivan Dubrov <ivan@commure.com>"]
edition = "2018"
repository = "https://github.com/commure/datatest"
Expand Down
5 changes: 2 additions & 3 deletions src/data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Support module for `#[datatest::data(..)]`
use serde::de::DeserializeOwned;
use std::boxed::FnBox;
use test::TDynBenchFn;
use yaml_rust::parser::Event;
use yaml_rust::scanner::Marker;
Expand All @@ -17,8 +16,8 @@ pub struct DataTestDesc {
/// Used internally for `#[datatest::data(..)]` tests.
#[doc(hidden)]
pub enum DataTestFn {
TestFn(Box<FnBox() + Send + 'static>),
BenchFn(Box<TDynBenchFn + 'static>),
TestFn(Box<dyn FnOnce() + Send + 'static>),
BenchFn(Box<dyn TDynBenchFn + 'static>),
}

/// Descriptor of the data test case where the type of the test case data is `T`.
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(test)]
#![feature(specialization)]
#![feature(fnbox)]
#![feature(termination_trait_lib)]
//! Crate for supporting data-driven tests.
//!
Expand Down
2 changes: 1 addition & 1 deletion src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ fn adjust_for_test_name(opts: &mut crate::test::TestOpts, name: &str) {
/// For regular tests, mapping is one-to-one, for our data driven tests, we generate as many
/// descriptors as test cases we discovered.
#[doc(hidden)]
pub fn runner(tests: &[&TestDescriptor]) {
pub fn runner(tests: &[&dyn TestDescriptor]) {
let args = std::env::args().collect::<Vec<_>>();
let mut opts = match crate::test::parse_opts(&args) {
Some(Ok(o)) => o,
Expand Down