diff_trees/
display_diff_opts.rs

1#[cfg(doc)]
2use crate::Diff;
3#[cfg(doc)]
4use std::fmt::Display;
5
6/// Options for [`Display`]ing a [`Diff`].
7#[derive(Debug, Default, Clone)]
8pub struct DisplayDiffOpts {
9    pub(crate) color: bool,
10}
11
12impl DisplayDiffOpts {
13    /// Create a new default [`DisplayDiffOpts`].
14    pub fn new() -> Self {
15        Default::default()
16    }
17
18    /// Whether to enable terminal colors when displaying the diff.
19    pub fn color(self, color: bool) -> Self {
20        Self { color }
21    }
22}