Skip to content

Commit

Permalink
fix: write_blob_stream() does not need Seek trait anymore.
Browse files Browse the repository at this point in the history
Internally, it has to turn it into a buffer so it's not needed anymore.
It also counteracts the idea of using a stream with arbitrarily big files.
  • Loading branch information
Byron committed Jan 4, 2025
1 parent 08a87de commit b85307b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gix/src/repository/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ impl crate::Repository {
/// we avoid writing duplicate objects using slow disks that will eventually have to be garbage collected.
///
/// If that is prohibitive, use the object database directly.
pub fn write_blob_stream(
&self,
mut bytes: impl std::io::Read + std::io::Seek,
) -> Result<Id<'_>, object::write::Error> {
pub fn write_blob_stream(&self, mut bytes: impl std::io::Read) -> Result<Id<'_>, object::write::Error> {
let mut buf = self.empty_reusable_buffer();
std::io::copy(&mut bytes, buf.deref_mut()).expect("write to memory works");

Expand Down

0 comments on commit b85307b

Please sign in to comment.