Remove unnecessary setters

Summary: There isn't much point to having a trivial setter method for a public field.

Reviewed By: krallin

Differential Revision: D28427464

fbshipit-source-id: e0800fae6f635612e72945e570ce4de692dfb7bb
This commit is contained in:
Robert Grosse 2021-05-14 09:39:10 -07:00 committed by Facebook GitHub Bot
parent effef3a2c3
commit 83eac5322b
2 changed files with 6 additions and 32 deletions

View File

@ -132,19 +132,19 @@ fn main(fb: FacebookInit) -> Result<(), Error> {
let dry_run = matches.readonly_storage().0;
if matches.is_present(ARG_DERIVE_TREES) {
prefs.enable_derive_trees();
prefs.derive_trees = true;
}
if matches.is_present(ARG_DERIVE_HG) {
prefs.enable_derive_hg();
prefs.derive_hg = true;
}
if matches.is_present(ARG_HGGIT_COMPATIBILITY) {
prefs.enable_hggit_compatibility();
prefs.hggit_compatibility = true;
}
if matches.is_present(ARG_BONSAI_GIT_MAPPING) {
prefs.enable_bonsai_git_mapping();
prefs.bonsai_git_mapping = true;
}
let path = Path::new(matches.value_of(ARG_GIT_REPOSITORY_PATH).unwrap());

View File

@ -124,6 +124,8 @@ pub struct GitimportPreferences {
pub derive_hg: bool,
pub hggit_compatibility: bool,
pub bonsai_git_mapping: bool,
/// Only for logging purpuses,
/// useful when several repos are imported simultainously.
pub gitrepo_name: Option<String>,
pub concurrency: usize,
}
@ -141,34 +143,6 @@ impl Default for GitimportPreferences {
}
}
impl GitimportPreferences {
pub fn enable_derive_trees(&mut self) {
self.derive_trees = true
}
pub fn enable_derive_hg(&mut self) {
self.derive_hg = true
}
pub fn enable_hggit_compatibility(&mut self) {
self.hggit_compatibility = true
}
pub fn enable_bonsai_git_mapping(&mut self) {
self.bonsai_git_mapping = true
}
/// Only for logging purpuses,
/// useful when several repos are imported simultainously.
pub fn set_gitrepo_name(&mut self, name: String) {
self.gitrepo_name = Some(name);
}
pub fn set_concurrency(&mut self, concurrency: usize) {
self.concurrency = concurrency;
}
}
pub fn oid_to_sha1(oid: &Oid) -> Result<hash::GitSha1, Error> {
hash::GitSha1::from_bytes(Bytes::copy_from_slice(oid.as_bytes()))
}