radicle-dev / radicle-git

Everything Radicle growing around Git
Other
35 stars 5 forks source link

surf: borrowed and owned Blob content #107

Closed FintanH closed 1 year ago

FintanH commented 1 year ago

Avoid copying the bytes content of a git2::Blob by introducing a generic parameter on Blob.

The parameter can either be a BlobRef or BlobVec, by using the to_owned function.

BlobRef and BlobVec both implement AsRef and Deref for [u8] to make them easier to use and allows the definition of generic functions on T.

FintanH commented 1 year ago

Improvements on top of https://github.com/radicle-dev/radicle-git/pull/99 :) thanks for laying the ground work :+1:

keepsimple1 commented 1 year ago

Improvements on top of #99 :) thanks for laying the ground work 👍

I think it's better for me to land #99 first: it will provide clearer authorship and history, as well as be easier to review changes. You can always submit / update improvements after that.