Skip to content

Commit ce2ee6c

Browse files
committed
Remove colored banner
This came out looking less good on other people's terminals.
1 parent bdc5631 commit ce2ee6c

File tree

5 files changed

+8
-90
lines changed

5 files changed

+8
-90
lines changed

src/banner.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +0,0 @@
1-
use crate::prng;
2-
use crate::term;
3-
use termcolor::Color;
4-
use termcolor::Color::*;
5-
6-
const WIDTH: usize = 30;
7-
const COLORS: &[Color] = &[Blue, Green, Red, Yellow, Yellow];
8-
const CHARS: &[char] = &['░', '▒'];
9-
10-
pub fn colorful() {
11-
println!();
12-
let mut rng = prng::get();
13-
14-
for _ in 0..WIDTH {
15-
let color = COLORS[rng.u32() as usize % COLORS.len()];
16-
term::color(color);
17-
18-
let ch = CHARS[rng.u32() as usize % CHARS.len()];
19-
print!("{}{}", ch, ch);
20-
}
21-
22-
term::reset();
23-
print!("\n\n");
24-
}
25-
26-
pub fn dotted() {
27-
println!("{}", "┈┈".repeat(WIDTH));
28-
}

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ mod term;
206206
#[macro_use]
207207
mod path;
208208

209-
mod banner;
210209
mod cargo;
211210
mod dependencies;
212211
mod env;
@@ -215,7 +214,6 @@ mod features;
215214
mod manifest;
216215
mod message;
217216
mod normalize;
218-
mod prng;
219217
mod run;
220218
mod rustflags;
221219

src/message.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use termcolor::Color::{self, *};
22

33
use super::{Expected, Test};
4-
use crate::banner;
54
use crate::error::Error;
65
use crate::normalize;
76
use crate::term;
@@ -183,8 +182,12 @@ pub(crate) fn warnings(warnings: &str) {
183182
}
184183

185184
fn snippet(color: Color, content: &str) {
185+
fn dotted_line() {
186+
println!("{}", "┈".repeat(60));
187+
}
188+
186189
term::color(color);
187-
banner::dotted();
190+
dotted_line();
188191

189192
// Color one line at a time because Travis does not preserve color setting
190193
// across output lines.
@@ -194,6 +197,6 @@ fn snippet(color: Color, content: &str) {
194197
}
195198

196199
term::color(color);
197-
banner::dotted();
200+
dotted_line();
198201
term::reset();
199202
}

src/prng.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/run.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::fs::{self, File};
55
use std::path::{Path, PathBuf};
66

77
use super::{Expected, Runner, Test};
8-
use crate::banner;
98
use crate::cargo;
109
use crate::dependencies::{self, Dependency};
1110
use crate::env::Update;
@@ -38,8 +37,7 @@ impl Runner {
3837
panic!("tests failed");
3938
});
4039

41-
println!();
42-
banner::colorful();
40+
print!("\n\n");
4341

4442
let len = tests.len();
4543
let mut failures = 0;
@@ -55,8 +53,7 @@ impl Runner {
5553
}
5654
}
5755

58-
banner::colorful();
59-
println!();
56+
print!("\n\n");
6057

6158
if failures > 0 && project.name != "trybuild-tests" {
6259
panic!("{} of {} tests failed", failures, len);

0 commit comments

Comments
 (0)