Skip to content

Commit 1bd8d52

Browse files
committed
fix!: symlinks_to_directories_are_ignored_like_directories by value
The methods of `gix::dirwalk::Options` are paired, where for each option `X` of `Options`, a method named like `X` takes and returns `self` by value, and a method `set_X` takes and returns `self` by mutable reference. But in `symlinks_to_directories_are_ignored_like_directories`, both took `self` by mutable reference. This fixes that. The effect of this fix is to allow building `Options` with a call to that method as the last factory method call (and using it where `Options` is accepted but `&mut Options` is not). Most code that consumes the crate should be unaffected, but: - Code where calls were ordered unnaturally to avoid putting such a call last should be able to be improved. - Code that used the method like its `set_*` countepart `set_symlinks_to_directories_are_ignored_like_directories` will be broken. That's what makes this fix a breaking change. Any such code can fixed by modifying it to call the `set_*` version instead, which is probably what would have been intended anyway.
1 parent f8ba4b9 commit 1bd8d52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gix/src/dirwalk/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Options {
173173
/// if `true` it will be excluded as the symlink is considered a directory.
174174
///
175175
/// In other words, for Git compatibility this flag should be `false`, the default, for `git2` compatibility it should be `true`.
176-
pub fn symlinks_to_directories_are_ignored_like_directories(&mut self, toggle: bool) -> &mut Self {
176+
pub fn symlinks_to_directories_are_ignored_like_directories(mut self, toggle: bool) -> Self {
177177
self.symlinks_to_directories_are_ignored_like_directories = toggle;
178178
self
179179
}

0 commit comments

Comments
 (0)