(path: &str)
| 623 | } |
| 624 | |
| 625 | fn read_input(path: &str) -> CliResult<String> { |
| 626 | if path == "-" { |
| 627 | use std::io::Read; |
| 628 | let mut buf = String::new(); |
| 629 | std::io::stdin().read_to_string(&mut buf)?; |
| 630 | Ok(buf) |
| 631 | } else { |
| 632 | Ok(std::fs::read_to_string(path)?) |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | #[cfg(test)] |
| 637 | mod tests { |