Skip to content

Commit 149d310

Browse files
committed
change: Adjust gix::dirwalk::Options::{X,set_X} parameter names
This adjusts the names of parameters to `X` and `set_X` methods of `gix::dirwalk::Options` (where `X` is an option name) to use a systematic naming convention: - For the same option `X`, the `X` and `set_X` methods now always have the same name of the parameter that specifies a value for an option. - Options whose type is `bool` are named `toggle`, in keeping with the prevailing convention in this code. - Options of `Option` type are named `value` (this required no changes). - Options of a non-`Option` type `*Mode` -- currently this is just `EmissionMode` -- are named `mode`.
1 parent 1bd8d52 commit 149d310

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gix/src/dirwalk/options.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ impl Options {
115115
self
116116
}
117117
/// Controls the way untracked files are emitted. By default, this is happening immediately and without any simplification.
118-
pub fn emit_untracked(mut self, toggle: EmissionMode) -> Self {
119-
self.emit_untracked = toggle;
118+
pub fn emit_untracked(mut self, mode: EmissionMode) -> Self {
119+
self.emit_untracked = mode;
120120
self
121121
}
122122
/// Like [`emit_untracked()`](Self::emit_untracked), but only requires a mutably borrowed instance.
123-
pub fn set_emit_untracked(&mut self, toggle: EmissionMode) -> &mut Self {
124-
self.emit_untracked = toggle;
123+
pub fn set_emit_untracked(&mut self, mode: EmissionMode) -> &mut Self {
124+
self.emit_untracked = mode;
125125
self
126126
}
127127
/// If `toggle` is `true`, emit empty directories as well. Note that a directory also counts as empty if it has any
@@ -180,8 +180,8 @@ impl Options {
180180

181181
/// Like [`symlinks_to_directories_are_ignored_like_directories()`](Self::symlinks_to_directories_are_ignored_like_directories),
182182
/// but only requires a mutably borrowed instance.
183-
pub fn set_symlinks_to_directories_are_ignored_like_directories(&mut self, value: bool) -> &mut Self {
184-
self.symlinks_to_directories_are_ignored_like_directories = value;
183+
pub fn set_symlinks_to_directories_are_ignored_like_directories(&mut self, toggle: bool) -> &mut Self {
184+
self.symlinks_to_directories_are_ignored_like_directories = toggle;
185185
self
186186
}
187187
}

0 commit comments

Comments
 (0)