Skip to content

Commit cd4ec24

Browse files
committed
process: don't re-export external items
1 parent 6fe0555 commit cd4ec24

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

src/cli/common.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::{cmp, env};
1010

1111
use anyhow::{Context, Result, anyhow};
1212
use git_testament::{git_testament, render_testament};
13+
use termcolor::Color;
1314
use tracing::{debug, error, info, trace, warn};
1415
use tracing_subscriber::{EnvFilter, Registry, reload::Handle};
1516

@@ -203,10 +204,10 @@ fn show_channel_updates(
203204
) -> Result<()> {
204205
let data = updates.into_iter().map(|(pkg, result)| {
205206
let (banner, color) = match &result {
206-
Ok(UpdateStatus::Installed) => ("installed", Some(terminal_source::Color::Green)),
207-
Ok(UpdateStatus::Updated(_)) => ("updated", Some(terminal_source::Color::Green)),
207+
Ok(UpdateStatus::Installed) => ("installed", Some(Color::Green)),
208+
Ok(UpdateStatus::Updated(_)) => ("updated", Some(Color::Green)),
208209
Ok(UpdateStatus::Unchanged) => ("unchanged", None),
209-
Err(_) => ("update failed", Some(terminal_source::Color::Red)),
210+
Err(_) => ("update failed", Some(Color::Red)),
210211
};
211212

212213
let (previous_version, version) = match &pkg {

src/cli/markdown.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
use std::io::Write;
33

44
use pulldown_cmark::{Event, Tag, TagEnd};
5+
use termcolor::Color;
56

6-
use crate::process::terminal_source::{Attr, Color, ColorableTerminal};
7+
use crate::process::terminal_source::{Attr, ColorableTerminal};
78

89
// Handles the wrapping of text written to the console
910
struct LineWrapper<'a> {

src/cli/rustup_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use console::style;
1717
use futures_util::stream::StreamExt;
1818
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
1919
use itertools::Itertools;
20+
use termcolor::ColorChoice;
2021
use tokio::sync::Semaphore;
2122
use tracing::{info, trace, warn};
2223
use tracing_subscriber::{EnvFilter, Registry, reload::Handle};
@@ -39,7 +40,7 @@ use crate::{
3940
install::{InstallMethod, UpdateStatus},
4041
process::{
4142
Process,
42-
terminal_source::{self, ColorChoice, ColorableTerminal},
43+
terminal_source::{self, ColorableTerminal},
4344
},
4445
toolchain::{
4546
CustomToolchainName, DistributableToolchain, LocalToolchainName,

src/cli/self_update.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use clap::builder::PossibleValue;
4747
use itertools::Itertools;
4848
use same_file::Handle;
4949
use serde::{Deserialize, Serialize};
50+
use termcolor::Color;
5051
use tracing::{error, info, trace, warn};
5152

5253
use crate::download::download_file;
@@ -1359,13 +1360,13 @@ pub(crate) async fn check_rustup_update(process: &Process) -> anyhow::Result<boo
13591360
write!(t.lock(), "rustup - ")?;
13601361

13611362
Ok(if current_version != available_version {
1362-
let _ = t.fg(terminal_source::Color::Yellow);
1363+
let _ = t.fg(Color::Yellow);
13631364
write!(t.lock(), "Update available")?;
13641365
let _ = t.reset();
13651366
writeln!(t.lock(), " : {current_version} -> {available_version}")?;
13661367
true
13671368
} else {
1368-
let _ = t.fg(terminal_source::Color::Green);
1369+
let _ = t.fg(Color::Green);
13691370
write!(t.lock(), "Up to date")?;
13701371
let _ = t.reset();
13711372
writeln!(t.lock(), " : {current_version}")?;

src/process/terminal_source.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ use std::{
99
sync::{Arc, Mutex, MutexGuard},
1010
};
1111

12-
pub(crate) use termcolor::{Color, ColorChoice};
13-
use termcolor::{ColorSpec, StandardStream, StandardStreamLock, WriteColor};
12+
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, StandardStreamLock, WriteColor};
1413

1514
use super::Process;
1615
#[cfg(feature = "test")]

0 commit comments

Comments
 (0)