Skip to content

Commit 32c99d7

Browse files
committed
Remove rust from matrix since it is not used (half the number of tests)
1 parent ac56d82 commit 32c99d7

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
rust:
17-
- stable
18-
- beta
1916
os:
2017
- ubuntu-latest
2118
- windows-latest
@@ -31,6 +28,7 @@ jobs:
3128
- run: cargo test
3229
- run: cargo test --no-default-features
3330
- run: cargo test --features=colored
31+
- run: cargo test --features=colored-3
3432
- run: cargo test --features=syslog-3
3533
- run: cargo test --features=syslog-4
3634
- run: cargo test --features=syslog-6
@@ -54,9 +52,6 @@ jobs:
5452
runs-on: ubuntu-latest
5553
strategy:
5654
matrix:
57-
rust:
58-
- stable
59-
- beta
6055
toolchain:
6156
- stable
6257
- 1.80.0

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ include = ["Cargo.toml", "src/**/*", "tests/**/*", "examples/**/*", "LICENSE", "
2020

2121
[dependencies]
2222
log = { version = "0.4", features = ["std"] }
23-
colored = { version = "3.0", optional = true }
23+
colored2 = { version = "2.1.0", package = "colored", optional = true }
24+
colored3 = { version = "3", package = "colored", optional = true }
2425
chrono = { version = "0.4", default-features = false, features = ["std", "clock"], optional = true }
2526

2627
[target."cfg(not(windows))".dependencies]
@@ -41,6 +42,8 @@ reopen-03 = ["reopen03", "libc"]
4142
reopen-1 = ["reopen1", "libc"]
4243
meta-logging-in-format = []
4344
date-based = ["chrono"]
45+
colored = ["colored2"]
46+
colored-3 = ["colored3"]
4447

4548
[dev-dependencies]
4649
tempfile = "3"

examples/syslog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(not(windows))]
2-
// This is necessary because `fern` depends on both version 3 and 4.
2+
// This is necessary because `fern` depends on multiple versions.
33
use syslog6 as syslog;
44

55
#[cfg(not(windows))]

examples/syslog3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(not(windows))]
2-
// This is necessary because `fern` depends on both version 3 and 4.
2+
// This is necessary because `fern` depends on multiple versions.
33
use syslog3 as syslog;
44

55
#[cfg(not(windows))]

examples/syslog4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(not(windows))]
2-
// This is necessary because `fern` depends on both version 3 and 4.
2+
// This is necessary because `fern` depends on multiple versions.
33
use syslog4 as syslog;
44

55
#[cfg(not(windows))]

examples/syslog7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(not(windows))]
2-
// This is necessary because `fern` depends on both version 3, 4 and 6
2+
// This is necessary because `fern` depends on multiple versions.
33
use syslog7 as syslog;
44

55
#[cfg(not(windows))]

src/colors.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Support for ANSI terminal colors via the colored crate.
22
//!
3-
//! To enable support for colors, add the `"colored"` feature in your
4-
//! `Cargo.toml`:
3+
//! To enable support for colors, add the `"colored"` or `"colored-3"`
4+
//! (version 3, which requires rust 1.80) feature in your `Cargo.toml`:
55
//!
66
//! ```toml
77
//! [dependencies]
@@ -56,7 +56,7 @@
5656
//! [ex]: https://github.com/daboross/fern/blob/fern-0.7.0/examples/pretty-colored.rs
5757
use std::fmt;
5858

59-
pub use colored::Color;
59+
pub use crate::colored::Color;
6060
use log::Level;
6161

6262
/// Extension crate allowing the use of `.colored` on Levels.
@@ -158,7 +158,7 @@ impl ColoredLevelConfig {
158158
pub fn new() -> Self {
159159
#[cfg(windows)]
160160
{
161-
let _ = colored::control::set_virtual_terminal(true);
161+
let _ = crate::colored::control::set_virtual_terminal(true);
162162
}
163163
Self::default()
164164
}
@@ -280,7 +280,7 @@ impl ColoredLogLevel for Level {
280280
#[cfg(test)]
281281
#[cfg(not(windows))]
282282
mod test {
283-
use colored::{Color::*, Colorize};
283+
use crate::colored::{Color::*, Colorize};
284284

285285
use super::WithFgColor;
286286

@@ -304,7 +304,7 @@ mod test {
304304
BrightCyan,
305305
BrightWhite,
306306
] {
307-
colored::control::SHOULD_COLORIZE.set_override(true);
307+
crate::colored::control::SHOULD_COLORIZE.set_override(true);
308308
assert_eq!(
309309
format!("{}", "test".color(color)),
310310
format!(

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,14 @@ mod builders;
251251
mod errors;
252252
mod log_impl;
253253

254-
#[cfg(feature = "colored")]
254+
#[cfg(any(feature = "colored", feature = "colored-3"))]
255255
pub mod colors;
256+
#[cfg(feature = "colored")]
257+
use colored2 as colored;
258+
259+
#[cfg(feature = "colored-3")]
260+
use colored3 as colored;
261+
256262
#[cfg(all(
257263
feature = "syslog-3",
258264
feature = "syslog-4",

0 commit comments

Comments
 (0)