summaryrefslogtreecommitdiffstats
path: root/vendor/tabled/src/settings/format/format_config.rs
blob: 247ead34400ec77de295601bfc1e4691ba0df446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::settings::TableOption;

/// This is a struct wrapper for a lambda which changes config.
#[derive(Debug)]
pub struct FormatConfig<F>(pub(crate) F);

impl<F, R, D, C> TableOption<R, D, C> for FormatConfig<F>
where
    F: FnMut(&mut C),
{
    fn change(mut self, _: &mut R, cfg: &mut C, _: &mut D) {
        (self.0)(cfg);
    }
}