Skip to content

Commit cd49709

Browse files
authored
Merge pull request #66 from epage/rename
chore: Update to anstream
2 parents d87a9e5 + 5de4b14 commit cd49709

File tree

6 files changed

+40
-44
lines changed

6 files changed

+40
-44
lines changed

Cargo.lock

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ env_logger = { version = "0.10.0", default-features = false, features = ["color"
3737
concolor = "0.1.1"
3838
concolor-clap = { version = "0.1.0", features = ["api"] }
3939
proc-exit = "2.0.1"
40-
human-panic = "1.1.2"
40+
human-panic = "1.1.3"
4141
anyhow = "1.0.68"
4242
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "regex-fancy"] }
4343
terminal_size = "0.2.3"
4444
textwrap = "0.16.0"
4545
anstyle = "0.3.1"
46-
anstyle-stream = "0.2.2"
46+
anstream = "0.2.2"
4747
is-terminal = "0.4.4"
4848
content_inspector = "0.2.4"
4949
encoding = "0.2.33"
@@ -57,5 +57,5 @@ once_cell = "1.17.0"
5757
bugreport = "0.5.0"
5858

5959
[dev-dependencies]
60-
snapbox = { version = "0.4.9", features = ["path"] }
60+
snapbox = { version = "0.4.10", features = ["path"] }
6161
term-transcript = "0.2.0"

src/blame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub fn blame(
1212
config: &mut Config,
1313
args: &crate::args::Args,
1414
) -> proc_exit::ExitResult {
15-
let colored_stdout = anstyle_stream::AutoStream::choice(&std::io::stdout())
16-
!= anstyle_stream::ColorChoice::Never;
15+
let colored_stdout =
16+
anstream::AutoStream::choice(&std::io::stdout()) != anstream::ColorChoice::Never;
1717
let total_width = terminal_size::terminal_size()
1818
.map(|(w, _h)| w.0)
1919
.or_else(|| std::env::var_os("COLUMNS").and_then(|s| s.to_str()?.parse::<u16>().ok()))

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn dump_config(output_path: &std::path::Path, config: &mut Config) -> proc_e
1616

1717
if output_path == std::path::Path::new("-") {
1818
use std::io::Write;
19-
anstyle_stream::stdout()
19+
anstream::stdout()
2020
.write_all(output.as_bytes())
2121
.with_code(proc_exit::Code::FAILURE)?;
2222
} else {

src/git_pager.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ pub struct Pager {
77

88
impl Pager {
99
pub fn stdout(args: &str) -> Self {
10-
let cmd = anstyle_stream::stdout()
10+
let cmd = anstream::stdout()
1111
.is_terminal()
1212
.then(|| parse(args))
1313
.flatten();
1414
Self { cmd }
1515
}
1616

1717
pub fn start(&mut self) -> ActivePager {
18-
let stdout = anstyle_stream::stdout().lock();
18+
let stdout = anstream::stdout().lock();
1919
if let Some(cmd) = &mut self.cmd {
2020
// should use pager instead of stderr
2121
if let Ok(p) = cmd.spawn() {
22-
let stderr = anstyle_stream::stderr()
22+
let stderr = anstream::stderr()
2323
.is_terminal()
24-
.then(|| anstyle_stream::stderr().lock());
24+
.then(|| anstream::stderr().lock());
2525
ActivePager {
2626
primary: stdout,
2727
_secondary: stderr,
@@ -45,8 +45,8 @@ impl Pager {
4545
}
4646

4747
pub struct ActivePager {
48-
primary: anstyle_stream::AutoStream<std::io::StdoutLock<'static>>,
49-
_secondary: Option<anstyle_stream::AutoStream<std::io::StderrLock<'static>>>,
48+
primary: anstream::AutoStream<std::io::StdoutLock<'static>>,
49+
_secondary: Option<anstream::AutoStream<std::io::StderrLock<'static>>>,
5050
pager: Option<std::process::Child>,
5151
}
5252

src/main.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ fn run() -> proc_exit::ExitResult {
5656
list_themes(&mut config)?;
5757
} else if args.acknowledgements {
5858
use std::io::Write;
59-
let _ = writeln!(
60-
anstyle_stream::stdout(),
61-
"{}",
62-
assets::get_acknowledgements()
63-
);
59+
let _ = writeln!(anstream::stdout(), "{}", assets::get_acknowledgements());
6460
} else if args.diagnostic {
6561
use bugreport::{bugreport, collector::*, format::Markdown};
6662

@@ -150,8 +146,8 @@ fn list_languages(config: &mut Config) -> proc_exit::ExitResult {
150146
}
151147

152148
fn list_themes(config: &mut Config) -> proc_exit::ExitResult {
153-
let colored_stdout = anstyle_stream::AutoStream::choice(&std::io::stdout())
154-
!= anstyle_stream::ColorChoice::Never;
149+
let colored_stdout =
150+
anstream::AutoStream::choice(&std::io::stdout()) != anstream::ColorChoice::Never;
155151
let pager = config.get(&crate::git2_config::PAGER);
156152
let mut pager = Pager::stdout(&pager);
157153
let mut pager = pager.start();

0 commit comments

Comments
 (0)