Skip to content

Commit 1b0ab44

Browse files
committed
make clear what 'steal' actually steals from (#293)
1 parent 7b2ab26 commit 1b0ab44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-repository/src/easy/object/impls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'repo> TryFrom<Object<'repo>> for Commit<'repo> {
3535
object::Kind::Commit => Ok(Commit {
3636
id: value.id,
3737
handle,
38-
data: steal(&mut value.data),
38+
data: steal_from_freelist(&mut value.data),
3939
}),
4040
_ => Err(value),
4141
}
@@ -51,7 +51,7 @@ impl<'repo> TryFrom<Object<'repo>> for Tree<'repo> {
5151
object::Kind::Tree => Ok(Tree {
5252
id: value.id,
5353
handle,
54-
data: steal(&mut value.data),
54+
data: steal_from_freelist(&mut value.data),
5555
}),
5656
_ => Err(value),
5757
}
@@ -60,6 +60,6 @@ impl<'repo> TryFrom<Object<'repo>> for Tree<'repo> {
6060

6161
/// In conjunction with the handles free list, leaving an empty Vec in place of the original causes it to not be
6262
/// returned to the free list.
63-
fn steal(data: &mut Vec<u8>) -> Vec<u8> {
63+
fn steal_from_freelist(data: &mut Vec<u8>) -> Vec<u8> {
6464
std::mem::take(data)
6565
}

0 commit comments

Comments
 (0)