Skip to content
Myr

error.rs

This file

Path

src/error.rs

12 lines · 310 bytes · Rust

Last changed by

fix: sanitize escape sequence injectioncurious-rabbitbefore adoption92c54d3

History of this file

Take it

The walk stopped after 200 commits: lines older than 8c7a84e point at it.

fix: sanitize escape sequence injectioncurious-rabbitbefore adoption92c54d3

lines 1–4why, one step back
1use std::io::IsTerminal;
23use crate::sanitize::sanitize_for_terminal;4

Merge pull request #1534 from tmccombs/msrv-updateThayne McCombsbefore adoption8c7a84e

line 5why, one step back
5pub fn print_error(msg: impl Into<String>) {

fix: sanitize escape sequence injectioncurious-rabbitbefore adoption92c54d3

lines 6–11why, one step back
6 let msg = msg.into();
7 if std::io::stderr().is_terminal() {8 eprintln!("[fd error]: {}", sanitize_for_terminal(&msg));9 } else {10 eprintln!("[fd error]: {msg}");11 }

Merge pull request #1534 from tmccombs/msrv-updateThayne McCombsbefore adoption8c7a84e

line 12why, one step back
12}