Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace atty::is(Stderr) with stdlib
Summary: `std::io::IsTerminal` was stabilized in 1.70. It is intended to be a drop in replacement for `atty::is(Stderr)`. This codemod replaces all usages of `atty::is(Stderr)` with `stderr().is_terminal()`, importing the necessary paths. It used this script (generated with assistance from Metamate): ``` #!/bin/bash files=$(fbgs -sl "atty::is(atty::Stream::Stderr)" | arc linttool debugfilterpaths --take RUSTFMT) for file in $files; do sed -i 's/atty::is(atty::Stream::Stderr)/stderr().is_terminal()/g' $file done for file in $files; do sed -i '1i use std::io::{stderr, IsTerminal};' $file done ``` `arc f` was ran twice, followed by two invocations of `arc lint -e extra --take RUSTFIXDEPS`. This script was a little naive though, and as a result, I had to manually move the newly added imports to the correct line. I ran lints again afterwards. Reviewed By: Imxset21 Differential Revision: D46601192 fbshipit-source-id: 18ef53a9fa25cbd733ca81f16b2c13ce8c5ddb98
- Loading branch information