Echo back input from stdin when disable_all_formatting is true
This commit is contained in:
parent
7e309a4ad8
commit
ede179c62e
@ -881,6 +881,12 @@ pub fn format_input<T: Write>(
|
||||
) -> Result<(Summary, FileMap, FormatReport), (io::Error, Summary)> {
|
||||
let mut summary = Summary::default();
|
||||
if config.disable_all_formatting() {
|
||||
// When the input is from stdin, echo back the input.
|
||||
if let Input::Text(ref buf) = input {
|
||||
if let Err(e) = io::stdout().write_all(buf.as_bytes()) {
|
||||
return Err((e, summary));
|
||||
}
|
||||
}
|
||||
return Ok((summary, FileMap::new(), FormatReport::new()));
|
||||
}
|
||||
let codemap = Rc::new(CodeMap::new(FilePathMapping::empty()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user