Skip to content
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
8 changes: 4 additions & 4 deletions src/revwalk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<'repo> Revwalk<'repo> {
/// the walk.
pub fn with_hide_callback<'cb, C>(
self,
callback: &'cb C,
callback: &'cb mut C,
) -> Result<RevwalkWithHideCb<'repo, 'cb, C>, Error>
where
C: FnMut(Oid) -> bool,
Expand All @@ -170,7 +170,7 @@ impl<'repo> Revwalk<'repo> {
raw::git_revwalk_add_hide_cb(
r.revwalk.raw(),
Some(revwalk_hide_cb::<C>),
callback as *const _ as *mut c_void,
callback as *mut _ as *mut c_void,
);
};
Ok(r)
Expand Down Expand Up @@ -304,8 +304,8 @@ mod tests {
walk.reset().unwrap();
walk.push_head().unwrap();

let hide_cb = |oid| oid == target;
let mut walk = walk.with_hide_callback(&hide_cb).unwrap();
let mut hide_cb = |oid| oid == target;
let mut walk = walk.with_hide_callback(&mut hide_cb).unwrap();

assert_eq!(walk.by_ref().count(), 0);

Expand Down