From dc1004c8aedc5595888f0c7843e7131ad89a4f3c Mon Sep 17 00:00:00 2001 From: emabee Date: Mon, 24 Aug 2020 16:03:42 +0200 Subject: [PATCH] [0.15.12] Ensure backwards-compatibility to rust version 1.37.0 - fixes emabee/flexi_logger#59 --- .travis.yml | 34 ++++++++++++++++++++-------------- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- scripts/qualify.rs | 2 ++ src/logger.rs | 7 +++++-- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95efb30..cc4699e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,32 @@ language: rust + rust: - stable - beta - nightly -matrix: - allow_failures: - - rust: nightly - - os: windows - fast_finish: true + - 1.37.0 os: - linux - windows - osx -cache: cargo +jobs: + fast_finish: true + allow_failures: + - rust: nightly + - os: windows + include: + - if: rust = stable OR rust = beta OR rust = nightly + script: + - cargo build + - cargo doc --all-features --no-deps + - cargo test --release + - cargo test --release --no-default-features + - cargo test --release --all-features -script: - - cargo build - - cargo build --all-features - - cargo build --release - - cargo build --release --all-features - - cargo test --release --all-features - - cargo test - - cargo doc --all-features --no-deps + - if: rust = "1.37.0" + script: + - cargo build --release + - cargo build --release --no-default-features + - cargo build --release --all-feature \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 18afd52..a8e612d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.15.12] - 2020-08-07 + +Make `1.37.0` the minimal rust version for `flexi_logger`. + ## [0.15.11] - 2020-08-07 Introduce feature `specfile_without_notification` to allow coping with OS issues diff --git a/Cargo.toml b/Cargo.toml index 507df55..199fc0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flexi_logger" -version = "0.15.11" +version = "0.15.12" authors = ["emabee "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/scripts/qualify.rs b/scripts/qualify.rs index c699c6b..d615dc1 100644 --- a/scripts/qualify.rs +++ b/scripts/qualify.rs @@ -47,6 +47,8 @@ fn main() { run_command!("cargo", "build"); run_command!("cargo", "build", "--no-default-features"); run_command!("cargo", "build", "--all-features"); + run_command!("cargo", "+1.37.0", "build", "--no-default-features"); + run_command!("cargo", "+1.37.0", "build", "--all-features"); run_command!("cargo", "build", "--release"); run_command!("cargo", "build", "--release", "--all-features"); diff --git a/src/logger.rs b/src/logger.rs index f524337..860e8a7 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -162,8 +162,11 @@ impl Logger { fn tty_format(_out: bool) -> FormatFunction { #[cfg(feature = "colors")] #[allow(clippy::used_underscore_binding)] - if (_out && atty::is(atty::Stream::Stdout)) || (!_out && atty::is(atty::Stream::Stderr)) { - return formats::colored_default_format; + { + if (_out && atty::is(atty::Stream::Stdout)) || (!_out && atty::is(atty::Stream::Stderr)) + { + return formats::colored_default_format; + } } formats::default_format }