mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 18:21:04 +00:00
Use dyn Trait for trait objects
This commit is contained in:
parent
d5b0502419
commit
87f021078e
@ -1,4 +1,3 @@
|
|||||||
use std::boxed::Box;
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ impl Printer for SimplePrinter {
|
|||||||
pub struct InteractivePrinter<'a> {
|
pub struct InteractivePrinter<'a> {
|
||||||
colors: Colors,
|
colors: Colors,
|
||||||
config: &'a Config<'a>,
|
config: &'a Config<'a>,
|
||||||
decorations: Vec<Box<Decoration>>,
|
decorations: Vec<Box<dyn Decoration>>,
|
||||||
panel_width: usize,
|
panel_width: usize,
|
||||||
ansi_prefix_sgr: String,
|
ansi_prefix_sgr: String,
|
||||||
pub line_changes: Option<LineChanges>,
|
pub line_changes: Option<LineChanges>,
|
||||||
@ -85,7 +84,7 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Create decorations.
|
// Create decorations.
|
||||||
let mut decorations: Vec<Box<Decoration>> = Vec::new();
|
let mut decorations: Vec<Box<dyn Decoration>> = Vec::new();
|
||||||
|
|
||||||
if config.output_components.numbers() {
|
if config.output_components.numbers() {
|
||||||
decorations.push(Box::new(LineNumberDecoration::new(&colors)));
|
decorations.push(Box::new(LineNumberDecoration::new(&colors)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user