Skip to content

Commit

Permalink
change: Adjust gix::dirwalk::Options::{X,set_X} parameter names
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
EliahKagan committed Dec 10, 2024
1 parent ea8b95f commit c0f4da5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gix/src/dirwalk/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ impl Options {
self
}
/// Controls the way untracked files are emitted. By default, this is happening immediately and without any simplification.
pub fn emit_untracked(mut self, toggle: EmissionMode) -> Self {
self.emit_untracked = toggle;
pub fn emit_untracked(mut self, mode: EmissionMode) -> Self {
self.emit_untracked = mode;
self
}
/// Like [`emit_untracked()`](Self::emit_untracked), but only requires a mutably borrowed instance.
pub fn set_emit_untracked(&mut self, toggle: EmissionMode) -> &mut Self {
self.emit_untracked = toggle;
pub fn set_emit_untracked(&mut self, mode: EmissionMode) -> &mut Self {
self.emit_untracked = mode;
self
}
/// If `toggle` is `true`, emit empty directories as well. Note that a directory also counts as empty if it has any
Expand Down Expand Up @@ -180,8 +180,8 @@ impl Options {

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

0 comments on commit c0f4da5

Please sign in to comment.