From 4569c8f87138951b231735da679d2878902325e8 Mon Sep 17 00:00:00 2001 From: Sharif Haason Date: Mon, 3 Oct 2022 23:00:25 -0400 Subject: [PATCH] Self-document `simple.rs` example with builder API --- examples/simple.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/examples/simple.rs b/examples/simple.rs index 575df7e..4cbf2a6 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -11,20 +11,13 @@ fn main() { let stdout = io::stdout(); let mut handle = stdout.lock(); - let show_color = true; - let show_char_panel = true; - let show_position_panel = true; - let use_squeezing = false; - let border_style = BorderStyle::Unicode; - let panels = 2; - let mut printer = PrinterBuilder::new(&mut handle) - .show_color(show_color) - .show_char_panel(show_char_panel) - .show_position_panel(show_position_panel) - .with_border_style(border_style) - .with_squeeze(use_squeezing) - .with_panels(panels) + .show_color(true) + .show_char_panel(true) + .show_position_panel(true) + .with_border_style(BorderStyle::Unicode) + .with_squeeze(false) + .with_panels(2) .build(); printer.print_all(&input[..]).unwrap(); }