Update examples

This commit is contained in:
sharkdp authored and David Peter committed 2020-04-22 23:55:28 +02:00
1 parent 49f4322054
commit 13f671b499
3 files changed
+4 -10

No files matched your search

+1 -4
View File
@@ -1,10 +1,7 @@
/// A program that prints its own source code using the bat library
use bat::{LineRange, PrettyPrinter, WrappingMode};
use std::ffi::OsStr;
fn main() {
let path_to_this_file = OsStr::new(file!());
PrettyPrinter::new()
.header(true)
.grid(true)
@@ -14,7 +11,7 @@ fn main() {
.highlight(LineRange::new(line!() as usize, line!() as usize))
.theme("1337")
.wrapping_mode(WrappingMode::Character)
.input_file(path_to_this_file)
.input_file(file!())
.print()
.expect("no errors");
}
+1 -4
View File
@@ -1,12 +1,9 @@
/// A simple program that prints its own source code using the bat library
use bat::PrettyPrinter;
use std::ffi::OsStr;
fn main() {
let path_to_this_file = OsStr::new(file!());
PrettyPrinter::new()
.input_file(path_to_this_file)
.input_file(file!())
.print()
.expect("no errors");
}