Skip to content

Commit 9c5444f

Browse files
committed
Update tty.rs
1 parent 3ffb925 commit 9c5444f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/uu/tty/src/tty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
6363
let stdin = std::io::stdin();
6464
let stdin_handle = stdin.as_handle();
6565
if stdin_handle.is_terminal() {
66-
if let Some(name) = file_name(stdin_handle) {
67-
writeln!(stdout, "{name}")
68-
} else {
69-
writeln!(stdout, r"\\.\CON")
70-
}
66+
writeln!(
67+
stdout,
68+
"{}",
69+
file_name(stdin_handle).as_deref().unwrap_or(r"\\.\CON")
70+
)
7171
} else {
7272
set_exit_code(1);
7373
writeln!(stdout, "{}", translate!("tty-not-a-tty"))

0 commit comments

Comments
 (0)