Skip to content

Fix a non-"set" dirwalk::Options method that took self by reference #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 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 @@ -173,15 +173,15 @@ impl Options {
/// if `true` it will be excluded as the symlink is considered a directory.
///
/// In other words, for Git compatibility this flag should be `false`, the default, for `git2` compatibility it should be `true`.
pub fn symlinks_to_directories_are_ignored_like_directories(&mut self, toggle: bool) -> &mut Self {
pub fn symlinks_to_directories_are_ignored_like_directories(mut self, toggle: bool) -> Self {
self.symlinks_to_directories_are_ignored_like_directories = toggle;
self
}

/// 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
}
}
Loading