use std::collections::BTreeMap;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Options {
pub infer_renames: bool,
pub rename_threshold: u8,
}
impl Default for Options {
fn default() -> Self {
Self {
infer_renames: false,
rename_threshold: 100,
}
}
}
impl Options {
#[must_use]
pub fn as_params(&self) -> BTreeMap<String, String> {
let mut m = BTreeMap::new();
m.insert("infer_renames".to_string(), self.infer_renames.to_string());
if self.infer_renames {
m.insert(
"rename_algorithm".to_string(),
"exact-content-move".to_string(),
);
m.insert(
"rename_threshold".to_string(),
self.rename_threshold.to_string(),
);
}
m
}
}