Add PrettyPrinter::input function
commit2f823d59b05b49f3286948dd8fdda5469dc22b8f
authorEthan P <eth-p+git@hidden.email>
dateFri 15 May 2020, 16:18 (6 years ago)
parent9813529
CHANGELOG.md+1
@@ -50,6 +50,7 @@
5050
5151- `PrettyPrinter::vcs_modification_markers` has been marked deprecated when building without the `git` feature, see #997 and #1020 (@eth-p, @sharkdp)
5252- Add APIs to provide `Input` descriptions with `InputDescription` (@eth-p)
53+- Add function to directly provide `Input`s to `PrettyPrinter` (@eth-p)
5354
5455## Packaging
5556
src/pretty_printer.rs+6
@@ -55,6 +55,12 @@ impl<'a> PrettyPrinter<'a> {
5555 }
5656 }
5757
58+ /// Add an input which should be pretty-printed
59+ pub fn input(&mut self, input: Input<'a>) -> &mut Self {
60+ self.inputs.push(input);
61+ self
62+ }
63+
5864 /// Add a file which should be pretty-printed
5965 pub fn input_file(&mut self, path: impl AsRef<OsStr>) -> &mut Self {
6066 self.inputs.push(Input::ordinary_file(path.as_ref()));