pub trait Config {
fn new(include_ts_fields: bool, ranges: bool) -> Self;
fn include_ts_fields(&self) -> bool;
fn fixes(&self) -> bool;
fn ranges(&self) -> bool;
}
pub struct ConfigNoFixes {
include_ts_fields: bool,
ranges: bool,
}
impl Config for ConfigNoFixes {
#[inline(always)]
fn new(include_ts_fields: bool, ranges: bool) -> Self {
Self { include_ts_fields, ranges }
}
#[inline(always)]
fn include_ts_fields(&self) -> bool {
self.include_ts_fields
}
#[inline(always)]
fn fixes(&self) -> bool {
false
}
#[inline(always)]
fn ranges(&self) -> bool {
self.ranges
}
}
pub struct ConfigFixes {
include_ts_fields: bool,
ranges: bool,
}
impl Config for ConfigFixes {
#[inline(always)]
fn new(include_ts_fields: bool, ranges: bool) -> Self {
Self { include_ts_fields, ranges }
}
#[inline(always)]
fn include_ts_fields(&self) -> bool {
self.include_ts_fields
}
#[inline(always)]
fn fixes(&self) -> bool {
true
}
#[inline(always)]
fn ranges(&self) -> bool {
self.ranges
}
}