From 1d2778842b8e859d1367712b881da695b2ca0c67 Mon Sep 17 00:00:00 2001 From: Peter Glotfelty Date: Thu, 17 Sep 2020 11:21:41 -0700 Subject: [PATCH] Re-Enable Travis via travis.com (#112) * Enable travis * add build.r to re-enable try_from --- .travis.yml | 2 +- README.md | 5 ++++- strum_tests/build.rs | 7 +++++++ travis.sh | 16 +--------------- 4 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 strum_tests/build.rs diff --git a/.travis.yml b/.travis.yml index 28d11037..4496d314 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ rust: - stable - beta - nightly - - 1.26.0 + - 1.31.1 matrix: allow_failures: - rust: nightly diff --git a/README.md b/README.md index b214c9db..7abf2595 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # Strum -[![Build Status](https://travis-ci.org/Peternator7/strum.svg?branch=master)](https://travis-ci.org/Peternator7/strum) +[![Build Status](https://travis-ci.com/Peternator7/strum.svg?branch=master)](https://travis-ci.com/Peternator7/strum) +[![Build status](https://ci.appveyor.com/api/projects/status/ji4f6n2m5lvu11xt?svg=true)](https://ci.appveyor.com/project/Peternator7/strum) [![Latest Version](https://img.shields.io/crates/v/strum.svg)](https://crates.io/crates/strum) [![Rust Documentation](https://docs.rs/strum/badge.svg)](https://docs.rs/strum) +![Crates.io](https://img.shields.io/crates/l/strum) +![Crates.io](https://img.shields.io/crates/d/strum) Strum is a set of macros and traits for working with enums and strings easier in Rust. diff --git a/strum_tests/build.rs b/strum_tests/build.rs new file mode 100644 index 00000000..23e46c5b --- /dev/null +++ b/strum_tests/build.rs @@ -0,0 +1,7 @@ + +fn main() { + // Check if version of rustc is >= 1.34 + if let Some(true) = version_check::is_min_version("1.34.0") { + println!("cargo:rustc-cfg=try_from"); + } +} \ No newline at end of file diff --git a/travis.sh b/travis.sh index ac335e73..1eaa844b 100755 --- a/travis.sh +++ b/travis.sh @@ -1,15 +1 @@ -cd ./strum -cargo build --verbose -cargo test --verbose - -cd .. -cd ./strum_tests -cargo build --verbose -cargo test --verbose - -cd .. -cd ./strum_tests_rename -cargo build --verbose -cargo test --verbose - -cd .. \ No newline at end of file +cargo test --verbose \ No newline at end of file