Skip to content

Commit

Permalink
impl Send for TreeUpdateBuilder (#784)
Browse files Browse the repository at this point in the history
TreeUpdateBuilder does not have any interior mutability, and the
underlying libgit2 data structures are safe to send to a different
thread as long as the old doesn't have a copy anymore.
  • Loading branch information
joshtriplett authored Dec 1, 2021
1 parent 2c67635 commit 5383afc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,8 @@ extern "C" fn notify_cb(
.unwrap_or(2)
}

unsafe impl Send for TreeUpdateBuilder {}

impl Default for TreeUpdateBuilder {
fn default() -> Self {
Self::new()
Expand Down

0 comments on commit 5383afc

Please sign in to comment.