on master help sign in
Use dyn Trait for trait objects
commit87f021078ec4ae266b6f69862644ac59e7cba8f7 authorsharkdp <davidpeter@web.de> dateSun 7 Oct 2018, 11:55 (8 years ago) parentd5b0502
1 file changed+2−3
src/printer.rs+2−3
src/printer.rs+2−3
@@ -1,4 +1,3 @@
1−use std::boxed::Box;
21use std::io::Write;
32use std::vec::Vec;
43
@@ -67,7 +66,7 @@ impl Printer for SimplePrinter {
6766pub struct InteractivePrinter<'a> {
6867 colors: Colors,
6968 config: &'a Config<'a>,
70− decorations: Vec<Box<Decoration>>,
69+ decorations: Vec<Box<dyn Decoration>>,
7170 panel_width: usize,
7271 ansi_prefix_sgr: String,
7372 pub line_changes: Option<LineChanges>,
@@ -85,7 +84,7 @@ impl<'a> InteractivePrinter<'a> {
8584 };
8685
8786 // Create decorations.
88− let mut decorations: Vec<Box<Decoration>> = Vec::new();
87+ let mut decorations: Vec<Box<dyn Decoration>> = Vec::new();
8988
9089 if config.output_components.numbers() {
9190 decorations.push(Box::new(LineNumberDecoration::new(&colors)));