From 018c4950b9406055dec02ef0fb52f132e2bb1e2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:25:56 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-utils/src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'vendor/gix-utils/src/lib.rs') diff --git a/vendor/gix-utils/src/lib.rs b/vendor/gix-utils/src/lib.rs index 4c9d99fa4..f5951b104 100644 --- a/vendor/gix-utils/src/lib.rs +++ b/vendor/gix-utils/src/lib.rs @@ -6,3 +6,20 @@ /// pub mod backoff; + +/// +pub mod buffers; + +/// A utility to do buffer-swapping with. +/// +/// Use `src` to read from and `dest` to write to, and after actually changing data, call [Buffers::swap()]. +/// To be able to repeat the process, this time using what was `dest` as `src`, freeing up `dest` for writing once more. +/// +/// Note that after each [`Buffers::swap()`], `src` is the most recent version of the data, just like before each swap. +#[derive(Default, Clone)] +pub struct Buffers { + /// The source data, as basis for processing. + pub src: Vec, + /// The data produced after processing `src`. + pub dest: Vec, +} -- cgit v1.2.3