on master help sign in
rename run => print
commitf034be71e7c1e8336d04ad3c6fdedca899c37d63 authorsharkdp <davidpeter@web.de> dateWed 22 Apr 2020, 20:33 (7 years ago) parenteee35e5
4 files changed+9−8
examples/cat.rs+1−1 examples/simple.rs+1−1 src/lib.rs+4−3 src/pretty_printer.rs+3−3
examples/cat.rs+1−1
@@ -12,6 +12,6 @@ fn main() {
1212 StyleComponent::Numbers,
1313 ]))
1414 .input_files(std::env::args_os().skip(1))
15− .run()
15+ .print()
1616 .expect("no errors");
1717}
examples/simple.rs+1−1
@@ -7,6 +7,6 @@ fn main() {
77
88 PrettyPrinter::new()
99 .input_file(path_to_this_file)
10− .run()
10+ .print()
1111 .expect("no errors");
1212}
src/lib.rs+4−3
@@ -1,10 +1,11 @@
11//! `bat` is a library to print syntax highlighted content.
22//!
3−//! The main struct is `PrettyPrinter` which can be used to configure and
4−//! run the syntax highlighting.
3+//! The main struct of this crate is `PrettyPrinter` which can be used to
4+//! configure and run the syntax highlighting.
5+//!
56//! If you need more control, you can also use the structs in the submodules
67//! (start with `controller::Controller`), but note that the API of these
7−//! internal modules much more likely to change.
8+//! internal modules is much more likely to change.
89//!
910//! "Hello world" example:
1011//! ```
src/pretty_printer.rs+3−3
@@ -160,10 +160,10 @@ impl<'a> PrettyPrinter<'a> {
160160 self
161161 }
162162
163− /// Pretty-print all specified inputs. This method will drain all stored inputs.
164− /// If you want to call 'run' multiple times, you have to call the appropriate
163+ /// Pretty-print all specified inputs. This method will "use" all stored inputs.
164+ /// If you want to call 'print' multiple times, you have to call the appropriate
165165 /// input_* methods again.
166− pub fn run(&mut self) -> Result<bool> {
166+ pub fn print(&mut self) -> Result<bool> {
167167 self.config.highlighted_lines =
168168 HighlightedLineRanges(LineRanges::from(self.highlighted_lines.clone()));
169169