diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
commit | 018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch) | |
tree | a835ebdf2088ef88fa681f8fad45f09922c1ae9a /vendor/gix-utils | |
parent | Adding debian version 1.75.0+dfsg1-5. (diff) | |
download | rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-utils')
-rw-r--r-- | vendor/gix-utils/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/gix-utils/CHANGELOG.md | 177 | ||||
-rw-r--r-- | vendor/gix-utils/Cargo.toml | 6 | ||||
-rw-r--r-- | vendor/gix-utils/LICENSE-MIT | 2 | ||||
-rw-r--r-- | vendor/gix-utils/src/buffers.rs | 54 | ||||
-rw-r--r-- | vendor/gix-utils/src/lib.rs | 17 | ||||
-rw-r--r-- | vendor/gix-utils/tests/backoff/mod.rs | 56 | ||||
-rw-r--r-- | vendor/gix-utils/tests/utils.rs | 1 |
8 files changed, 77 insertions, 238 deletions
diff --git a/vendor/gix-utils/.cargo-checksum.json b/vendor/gix-utils/.cargo-checksum.json index 81302bced..c7127197b 100644 --- a/vendor/gix-utils/.cargo-checksum.json +++ b/vendor/gix-utils/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"bba2f43788d3ac6c587ab6fe1eff08b46e271aab0d4889b23415f93b2b18a0fc","Cargo.toml":"1f26096d7878f5b421c2297854e036869cbf527391ba15aa74493170ec6021e4","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/backoff.rs":"13a27184095bb012e34e5f2fa6780080262c247d5812b40fe1bc5c6c0693fc04","src/lib.rs":"f3f0e3f90fe811a3ab340a3a2de2fc26dd77f6262c8518343abbd74f310296f7","tests/backoff/mod.rs":"c6ff28587f4c2b3ae3a76f4eddef1ac51bb8b52bde012a5571c6ac097da57b65","tests/utils.rs":"ab95e8f32f25da9d2d7af49c4f0572fe60199cbb908cd2b3d0aec28dce83cb91"},"package":"b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f"}
\ No newline at end of file +{"files":{"Cargo.toml":"6105c581c925e2122b047cec359bc8a1f5e3d6f89ef1a345ac7036f12db3f184","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"6f610e51b59dfbcbee281f58cc6d963bf716199dc7384dbaa94ccc3a6e343ce6","src/backoff.rs":"13a27184095bb012e34e5f2fa6780080262c247d5812b40fe1bc5c6c0693fc04","src/buffers.rs":"650768f509c86f82f144a5f4d937aa82b6ba732cfda6932b18f2bb5c621696ac","src/lib.rs":"e205fae8f2f6daf75e1a4c484d4900253507288d70b7a94ea761b4d61dd50cb9"},"package":"9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e"}
\ No newline at end of file diff --git a/vendor/gix-utils/CHANGELOG.md b/vendor/gix-utils/CHANGELOG.md deleted file mode 100644 index c966a2f2a..000000000 --- a/vendor/gix-utils/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## 0.1.5 (2023-07-22) - -A maintenance release without user-facing changes. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 5 commits contributed to the release over the course of 1 calendar day. - - 23 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **Uncategorized** - - Release gix-features v0.32.1, gix-actor v0.24.1, gix-validate v0.7.7, gix-object v0.33.1, gix-path v0.8.4, gix-glob v0.10.1, gix-quote v0.4.6, gix-attributes v0.16.0, gix-command v0.2.8, gix-packetline-blocking v0.16.4, gix-filter v0.2.0, gix-fs v0.4.1, gix-chunk v0.4.4, gix-commitgraph v0.18.1, gix-hashtable v0.2.4, gix-revwalk v0.4.1, gix-traverse v0.30.1, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.5, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.1, gix-sec v0.8.4, gix-prompt v0.5.4, gix-url v0.21.1, gix-credentials v0.17.1, gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0, safety bump 5 crates ([`16295b5`](https://github.com/Byron/gitoxide/commit/16295b58e2581d2e8b8b762816f52baabe871c75)) - - Prepare more changelogs ([`c4cc5f2`](https://github.com/Byron/gitoxide/commit/c4cc5f261d29f712a101033a18293a97a9d4ae85)) - - Release gix-date v0.7.1, gix-hash v0.11.4, gix-trace v0.1.3, gix-features v0.32.0, gix-actor v0.24.0, gix-validate v0.7.7, gix-object v0.33.0, gix-path v0.8.4, gix-glob v0.10.0, gix-quote v0.4.6, gix-attributes v0.15.0, gix-command v0.2.7, gix-packetline-blocking v0.16.3, gix-filter v0.1.0, gix-fs v0.4.0, gix-chunk v0.4.4, gix-commitgraph v0.18.0, gix-hashtable v0.2.4, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.4, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.0, gix-sec v0.8.4, gix-prompt v0.5.3, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-ignore v0.5.0, gix-bitmap v0.2.6, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-packetline v0.16.4, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.1 ([`5cb3589`](https://github.com/Byron/gitoxide/commit/5cb3589b74fc5376e02cbfe151e71344e1c417fe)) - - Update changelogs prior to release ([`2fc66b5`](https://github.com/Byron/gitoxide/commit/2fc66b55097ed494b72d1af939ba5561f71fde97)) - - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e)) -</details> - -## 0.1.4 (2023-06-29) - -A maintenance release without user-facing changes. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 3 commits contributed to the release over the course of 6 calendar days. - - 6 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **Uncategorized** - - Release gix-date v0.7.0, gix-trace v0.1.2, gix-actor v0.23.0, gix-commitgraph v0.17.1, gix-utils v0.1.4, gix-object v0.32.0, gix-ref v0.32.0, gix-config v0.25.0, gix-diff v0.32.0, gix-discover v0.21.0, gix-hashtable v0.2.3, gix-revwalk v0.3.0, gix-traverse v0.29.0, gix-index v0.20.0, gix-mailmap v0.15.0, gix-negotiate v0.4.0, gix-pack v0.39.0, gix-odb v0.49.0, gix-protocol v0.35.0, gix-revision v0.17.0, gix-refspec v0.13.0, gix-worktree v0.21.0, gix v0.48.0, safety bump 20 crates ([`27e8c18`](https://github.com/Byron/gitoxide/commit/27e8c18db5a9a21843381c116a8ed6d9f681b3f8)) - - Prepare changelogs prior to release ([`00f96fb`](https://github.com/Byron/gitoxide/commit/00f96fb3110a8f81a1bd0d74c757c15b8773c6f6)) - - Upgrade memmap2 and fastrand dependencies ([`6fc7497`](https://github.com/Byron/gitoxide/commit/6fc74971ac6838cbfd9c869ba3746713001d7a38)) -</details> - -## 0.1.3 (2023-06-22) - -A maintenance release without user-facing changes. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 4 commits contributed to the release over the course of 5 calendar days. - - 15 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **Uncategorized** - - Release gix-date v0.6.0, gix-hash v0.11.3, gix-trace v0.1.1, gix-features v0.31.0, gix-actor v0.22.0, gix-path v0.8.2, gix-glob v0.9.0, gix-quote v0.4.5, gix-attributes v0.14.0, gix-chunk v0.4.3, gix-commitgraph v0.17.0, gix-config-value v0.12.2, gix-fs v0.3.0, gix-tempfile v7.0.0, gix-utils v0.1.3, gix-lock v7.0.0, gix-validate v0.7.6, gix-object v0.31.0, gix-ref v0.31.0, gix-sec v0.8.2, gix-config v0.24.0, gix-command v0.2.6, gix-prompt v0.5.2, gix-url v0.20.0, gix-credentials v0.16.0, gix-diff v0.31.0, gix-discover v0.20.0, gix-hashtable v0.2.2, gix-ignore v0.4.0, gix-bitmap v0.2.5, gix-revwalk v0.2.0, gix-traverse v0.28.0, gix-index v0.19.0, gix-mailmap v0.14.0, gix-negotiate v0.3.0, gix-pack v0.38.0, gix-odb v0.48.0, gix-packetline v0.16.3, gix-transport v0.33.0, gix-protocol v0.34.0, gix-revision v0.16.0, gix-refspec v0.12.0, gix-worktree v0.20.0, gix v0.47.0, gitoxide-core v0.29.0, gitoxide v0.27.0, safety bump 30 crates ([`ea9f942`](https://github.com/Byron/gitoxide/commit/ea9f9424e777f10da0e33bb9ffbbefd01c4c5a74)) - - Prepare changelogs prior to release ([`18b0a37`](https://github.com/Byron/gitoxide/commit/18b0a371941aa2d4d62512437d5daa351ba99ffd)) - - Merge branch 'corpus' ([`aa16c8c`](https://github.com/Byron/gitoxide/commit/aa16c8ce91452a3e3063cf1cf0240b6014c4743f)) - - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30)) -</details> - -## 0.1.2 (2023-06-06) - -A maintenance release without user-facing changes. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 5 commits contributed to the release over the course of 12 calendar days. - - 41 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **Uncategorized** - - Release gix-date v0.5.1, gix-hash v0.11.2, gix-features v0.30.0, gix-actor v0.21.0, gix-path v0.8.1, gix-glob v0.8.0, gix-quote v0.4.4, gix-attributes v0.13.0, gix-chunk v0.4.2, gix-commitgraph v0.16.0, gix-config-value v0.12.1, gix-fs v0.2.0, gix-tempfile v6.0.0, gix-utils v0.1.2, gix-lock v6.0.0, gix-validate v0.7.5, gix-object v0.30.0, gix-ref v0.30.0, gix-sec v0.8.1, gix-config v0.23.0, gix-command v0.2.5, gix-prompt v0.5.1, gix-url v0.19.0, gix-credentials v0.15.0, gix-diff v0.30.0, gix-discover v0.19.0, gix-hashtable v0.2.1, gix-ignore v0.3.0, gix-bitmap v0.2.4, gix-traverse v0.26.0, gix-index v0.17.0, gix-mailmap v0.13.0, gix-revision v0.15.0, gix-negotiate v0.2.0, gix-pack v0.36.0, gix-odb v0.46.0, gix-packetline v0.16.2, gix-transport v0.32.0, gix-protocol v0.33.0, gix-refspec v0.11.0, gix-worktree v0.18.0, gix v0.45.0, safety bump 29 crates ([`9a9fa96`](https://github.com/Byron/gitoxide/commit/9a9fa96fa8a722bddc5c3b2270b0edf8f6615141)) - - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b)) - - Merge branch 'main' into auto-clippy ([`3ef5c90`](https://github.com/Byron/gitoxide/commit/3ef5c90aebce23385815f1df674c1d28d58b4b0d)) - - Merge branch 'blinxen/main' ([`9375cd7`](https://github.com/Byron/gitoxide/commit/9375cd75b01aa22a0e2eed6305fe45fabfd6c1ac)) - - Include license files in all crates ([`facaaf6`](https://github.com/Byron/gitoxide/commit/facaaf633f01c857dcf2572c6dbe0a92b7105c1c)) -</details> - -## 0.1.1 (2023-04-26) - -A maintenance release without user-facing changes. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 4 commits contributed to the release over the course of 1 calendar day. - - 7 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **Uncategorized** - - Release gix-hash v0.11.1, gix-path v0.7.4, gix-glob v0.6.0, gix-attributes v0.11.0, gix-config-value v0.11.0, gix-fs v0.1.1, gix-tempfile v5.0.3, gix-utils v0.1.1, gix-lock v5.0.1, gix-object v0.29.1, gix-ref v0.28.0, gix-sec v0.7.0, gix-config v0.21.0, gix-prompt v0.4.0, gix-url v0.17.0, gix-credentials v0.13.0, gix-diff v0.29.0, gix-discover v0.17.0, gix-hashtable v0.2.0, gix-ignore v0.1.0, gix-bitmap v0.2.3, gix-traverse v0.25.0, gix-index v0.16.0, gix-mailmap v0.12.0, gix-pack v0.34.0, gix-odb v0.44.0, gix-packetline v0.16.0, gix-transport v0.30.0, gix-protocol v0.31.0, gix-revision v0.13.0, gix-refspec v0.10.0, gix-worktree v0.16.0, gix v0.44.0, safety bump 7 crates ([`91134a1`](https://github.com/Byron/gitoxide/commit/91134a11c8ba0e942f692488ec9bce9fa1086324)) - - Prepare changelogs prior to release ([`30a1a71`](https://github.com/Byron/gitoxide/commit/30a1a71f36f24faac0e0b362ffdfedea7f9cdbf1)) - - Merge branch 'index-entries-attrs' ([`f37a930`](https://github.com/Byron/gitoxide/commit/f37a930aefa27e67f0b693ba9669cc26d49044fa)) - - Indicate that `gix-utils` is in early mode. ([`0f3b65f`](https://github.com/Byron/gitoxide/commit/0f3b65fdc210aded0a4e4ab72267e81141509122)) -</details> - -## 0.1.0 (2023-04-19) - -### New Features (BREAKING) - - - <csr-id-b83ee366a3c65c717beb587ad809268f1c54b8ad/> Rename `serde1` cargo feature to `serde` and use the weak-deps cargo capability. - With it it's possible to not automatically declare all optional dependencies externally visible - features, and thus re-use feature names that oterwise are also a crate name. - - Previously I thought that `serde1` is for future-proofing and supporting multiple serde versions - at the same time. However, it's most definitely a burden I wouldn't want anyway, so using - `serde` seems to be the way to go into the future. - -### Commit Statistics - -<csr-read-only-do-not-edit/> - - - 9 commits contributed to the release over the course of 5 calendar days. - - 1 commit was understood as [conventional](https://www.conventionalcommits.org). - - 1 unique issue was worked on: [#814](https://github.com/Byron/gitoxide/issues/814) - -### Commit Details - -<csr-read-only-do-not-edit/> - -<details><summary>view details</summary> - - * **[#814](https://github.com/Byron/gitoxide/issues/814)** - - Rename `serde1` cargo feature to `serde` and use the weak-deps cargo capability. ([`b83ee36`](https://github.com/Byron/gitoxide/commit/b83ee366a3c65c717beb587ad809268f1c54b8ad)) - * **Uncategorized** - - Release gix-utils v0.1.0, gix-hash v0.11.0, gix-date v0.5.0, gix-features v0.29.0, gix-actor v0.20.0, gix-object v0.29.0, gix-archive v0.1.0, gix-fs v0.1.0, safety bump 25 crates ([`8dbd0a6`](https://github.com/Byron/gitoxide/commit/8dbd0a60557a85acfa231800a058cbac0271a8cf)) - - Prepare changelog prior to release ([`7f06458`](https://github.com/Byron/gitoxide/commit/7f064583bd0e1b078df89a7750f5a25deb70f516)) - - Make fmt ([`5d2b5d0`](https://github.com/Byron/gitoxide/commit/5d2b5d02c3869e07dc2507a8f2519ee1df633df7)) - - Rename the serde1 feature to serde ([`19338d9`](https://github.com/Byron/gitoxide/commit/19338d934b6712b7d6bd3fa3b2e4189bf7e6c8a1)) - - Create new `gix-fs` crate to consolidate all filesystem utilities ([`f8cc33c`](https://github.com/Byron/gitoxide/commit/f8cc33cb372dd2b4bbe4a09cf4f64916681ab1dd)) - - Merge branch 'main' into dev ([`23ee47f`](https://github.com/Byron/gitoxide/commit/23ee47fb24c197f8437bd426544b2aa74e005bdc)) - - Merge branch 'worktree-stack' ([`3d47919`](https://github.com/Byron/gitoxide/commit/3d47919c1a2f83fc7c1fd7ae590d098057a22626)) - - A new create for filesystem specific utilities ([`ef8f405`](https://github.com/Byron/gitoxide/commit/ef8f405d06adf100bbe5f0b1fccbe8bb2c6fd650)) -</details> - diff --git a/vendor/gix-utils/Cargo.toml b/vendor/gix-utils/Cargo.toml index 169ebb2da..56b282db3 100644 --- a/vendor/gix-utils/Cargo.toml +++ b/vendor/gix-utils/Cargo.toml @@ -13,8 +13,12 @@ edition = "2021" rust-version = "1.65" name = "gix-utils" -version = "0.1.5" +version = "0.1.6" authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"] +include = [ + "src/**/*", + "LICENSE-*", +] description = "A crate with `gitoxide` utilities that don't need feature toggles" license = "MIT OR Apache-2.0" repository = "https://github.com/Byron/gitoxide" diff --git a/vendor/gix-utils/LICENSE-MIT b/vendor/gix-utils/LICENSE-MIT index b58e818f1..97c2fa7d8 100644 --- a/vendor/gix-utils/LICENSE-MIT +++ b/vendor/gix-utils/LICENSE-MIT @@ -1,5 +1,3 @@ -MIT License - Copyright (c) 2018-2021 Sebastian Thiel, and [contributors](https://github.com/byron/gitoxide/contributors). Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/gix-utils/src/buffers.rs b/vendor/gix-utils/src/buffers.rs new file mode 100644 index 000000000..2c0544ea3 --- /dev/null +++ b/vendor/gix-utils/src/buffers.rs @@ -0,0 +1,54 @@ +use crate::Buffers; + +/// Lifecycle +impl Buffers { + /// Use this if there is an input buffer `src` which isn't owned by you, but which should be used as source when + /// asking for [`src_and_dest()`](WithForeignSource::src_and_dest()). + pub fn use_foreign_src<'a, 'src>(&'a mut self, src: &'src [u8]) -> WithForeignSource<'src, 'a> { + self.clear(); + WithForeignSource { + ro_src: Some(src), + src: &mut self.src, + dest: &mut self.dest, + } + } +} + +impl Buffers { + /// Clear all buffers, which should be called once processing is done. + pub fn clear(&mut self) { + self.src.clear(); + self.dest.clear(); + } + + /// Must be called after every change (i.e. when it's known that `dest` was written. + pub fn swap(&mut self) { + std::mem::swap(&mut self.src, &mut self.dest); + } +} + +/// A utility to do buffer-swapping with, similar to [`Buffers`], but with support for a +/// read-only one-time buffer as source. +pub struct WithForeignSource<'src, 'bufs> { + /// The original source buffer, or `None` if already altered. + pub ro_src: Option<&'src [u8]>, + /// The source buffer that will be used after the first call to `swap`. + pub src: &'bufs mut Vec<u8>, + dest: &'bufs mut Vec<u8>, +} + +impl<'bufs> WithForeignSource<'_, 'bufs> { + /// Must be called after every change (i.e. when it's known that `dest` was written. + pub fn swap(&mut self) { + self.ro_src.take(); + std::mem::swap(&mut self.src, &mut self.dest); + self.dest.clear(); + } + /// Obtain `(source, destination)`, which reads from the read-only source exactly once. + pub fn src_and_dest(&mut self) -> (&[u8], &mut Vec<u8>) { + match self.ro_src { + Some(src) => (src, &mut self.dest), + None => (self.src, &mut self.dest), + } + } +} 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<u8>, + /// The data produced after processing `src`. + pub dest: Vec<u8>, +} diff --git a/vendor/gix-utils/tests/backoff/mod.rs b/vendor/gix-utils/tests/backoff/mod.rs deleted file mode 100644 index a84ed7543..000000000 --- a/vendor/gix-utils/tests/backoff/mod.rs +++ /dev/null @@ -1,56 +0,0 @@ -use std::{convert::TryInto, time::Duration}; - -use gix_utils::backoff::Exponential; - -const EXPECTED_TILL_SECOND: &[usize] = &[ - 1usize, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, - 625, 676, 729, 784, 841, 900, 961, 1000, 1000, -]; - -#[test] -fn random_exponential_produces_values_in_the_correct_range() { - let mut num_identities = 0; - for (actual, expected) in Exponential::default_with_random().zip(EXPECTED_TILL_SECOND) { - let actual: usize = actual.as_millis().try_into().unwrap(); - if actual == *expected { - num_identities += 1; - } - assert!( - actual * 1000 >= (expected - 1) * 750, - "value too small: {actual} < {expected}" - ); - assert!( - actual * 1000 <= (expected + 1) * 1250, - "value too big: {actual} > {expected}" - ); - } - assert!( - num_identities < EXPECTED_TILL_SECOND.len(), - "too many untransformed values: {num_identities}" - ); -} - -#[test] -fn how_many_iterations_for_a_second_of_waittime() { - let max = Duration::from_millis(1000); - assert_eq!(Exponential::default().until_no_remaining(max).count(), 14); - assert_eq!( - Exponential::default() - .until_no_remaining(max) - .reduce(|acc, n| acc + n) - .unwrap(), - Duration::from_millis(1015), - "a little overshoot" - ); -} - -#[test] -fn output_with_default_settings() { - assert_eq!( - Exponential::default().take(33).collect::<Vec<_>>(), - EXPECTED_TILL_SECOND - .iter() - .map(|n| Duration::from_millis(*n as u64)) - .collect::<Vec<_>>() - ); -} diff --git a/vendor/gix-utils/tests/utils.rs b/vendor/gix-utils/tests/utils.rs deleted file mode 100644 index ed38d3e98..000000000 --- a/vendor/gix-utils/tests/utils.rs +++ /dev/null @@ -1 +0,0 @@ -mod backoff; |