summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-22 20:33:19 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-04-22 23:55:28 +0200
commitf034be71e7c1e8336d04ad3c6fdedca899c37d63 (patch)
tree9234f448e94c4f8fc5b892012f3fb0f86c4bf237
parenteee35e54e962898dfd8be1b6b0d48d885a4f0319 (diff)
rename run => print
-rw-r--r--examples/cat.rs2
-rw-r--r--examples/simple.rs2
-rw-r--r--src/lib.rs7
-rw-r--r--src/pretty_printer.rs6
4 files changed, 9 insertions, 8 deletions
diff --git a/examples/cat.rs b/examples/cat.rs
index c1c9b242..5111a086 100644
--- a/examples/cat.rs
+++ b/examples/cat.rs
@@ -12,6 +12,6 @@ fn main() {
StyleComponent::Numbers,
]))
.input_files(std::env::args_os().skip(1))
- .run()
+ .print()
.expect("no errors");
}
diff --git a/examples/simple.rs b/examples/simple.rs
index c30cbd2a..8459c6ab 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -7,6 +7,6 @@ fn main() {
PrettyPrinter::new()
.input_file(path_to_this_file)
- .run()
+ .print()
.expect("no errors");
}
diff --git a/src/lib.rs b/src/lib.rs
index db7ce543..2b14c11e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,10 +1,11 @@
//! `bat` is a library to print syntax highlighted content.
//!
-//! The main struct is `PrettyPrinter` which can be used to configure and
-//! run the syntax highlighting.
+//! The main struct of this crate is `PrettyPrinter` which can be used to
+//! configure and run the syntax highlighting.
+//!
//! If you need more control, you can also use the structs in the submodules
//! (start with `controller::Controller`), but note that the API of these
-//! internal modules much more likely to change.
+//! internal modules is much more likely to change.
//!
//! "Hello world" example:
//! ```
diff --git a/src/pretty_printer.rs b/src/pretty_printer.rs
index 67a4ee59..91d5be54 100644
--- a/src/pretty_printer.rs
+++ b/src/pretty_printer.rs
@@ -160,10 +160,10 @@ impl<'a> PrettyPrinter<'a> {
self
}
- /// Pretty-print all specified inputs. This method will drain all stored inputs.
- /// If you want to call 'run' multiple times, you have to call the appropriate
+ /// Pretty-print all specified inputs. This method will "use" all stored inputs.
+ /// If you want to call 'print' multiple times, you have to call the appropriate
/// input_* methods again.
- pub fn run(&mut self) -> Result<bool> {
+ pub fn print(&mut self) -> Result<bool> {
self.config.highlighted_lines =
HighlightedLineRanges(LineRanges::from(self.highlighted_lines.clone()));