Skip to content

Commit

Permalink
Merge pull request #253 from Pi-Cla/IsTerminal
Browse files Browse the repository at this point in the history
Replace is-terminal with IsTerminal Trait
  • Loading branch information
epage authored Aug 13, 2024
2 parents 487c6c9 + 29203b1 commit e2913fa
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
18 changes: 0 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@ serde = "1.0.199"
ctrlc = "3.4.4"
crossbeam-channel = "0.5.12"
signal-hook = "0.3.17"
is-terminal = "0.4.12"
3 changes: 1 addition & 2 deletions src/in-depth/machine-communication-stdin.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use clap::{CommandFactory, Parser};
use is_terminal::IsTerminal as _;
use std::{
fs::File,
io::{stdin, BufRead, BufReader},
io::{stdin, BufRead, BufReader, IsTerminal},
path::PathBuf,
};

Expand Down
6 changes: 3 additions & 3 deletions src/in-depth/machine-communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ The first question to ask is:
Is our output for a human in front of a colorful terminal,
or for another program?
To answer this,
we can use a crate like [is-terminal]:
we can use the [IsTerminal] trait:

[is-terminal]: https://crates.io/crates/is-terminal
[IsTerminal]: https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html

```rust,ignore
use is_terminal::IsTerminal as _;
use std::io::IsTerminal;
if std::io::stdout().is_terminal() {
println!("I'm a terminal");
Expand Down
1 change: 0 additions & 1 deletion src/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Collaboration / help
- [exitcode](https://crates.io/crates/exitcode) - system exit code constants
- [human-panic](https://crates.io/crates/human-panic) - panic message handler
- [indicatif](https://crates.io/crates/indicatif) - progress bars and spinners
- [is-terminal](https://crates.io/crates/is-terminal) - detected whether application is running in a tty
- [log](https://crates.io/crates/log) - provides logging abstracted over implementation
- [predicates](https://crates.io/crates/predicates) - implements boolean-valued predicate functions
- [proptest](https://crates.io/crates/proptest) - property testing framework
Expand Down

0 comments on commit e2913fa

Please sign in to comment.