summaryrefslogtreecommitdiffstats
path: root/vendor/gix-features
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix-features')
-rw-r--r--vendor/gix-features/.cargo-checksum.json2
-rw-r--r--vendor/gix-features/CHANGELOG.md67
-rw-r--r--vendor/gix-features/Cargo.toml9
-rw-r--r--vendor/gix-features/LICENSE-APACHE191
-rw-r--r--vendor/gix-features/LICENSE-MIT21
-rw-r--r--vendor/gix-features/src/fs.rs28
-rw-r--r--vendor/gix-features/src/parallel/in_parallel.rs66
-rw-r--r--vendor/gix-features/src/parallel/mod.rs47
-rw-r--r--vendor/gix-features/src/parallel/serial.rs46
-rw-r--r--vendor/gix-features/src/progress.rs2
-rw-r--r--vendor/gix-features/src/threading.rs2
-rw-r--r--vendor/gix-features/src/zlib/mod.rs5
-rw-r--r--vendor/gix-features/src/zlib/stream/deflate/mod.rs19
-rw-r--r--vendor/gix-features/src/zlib/stream/deflate/tests.rs4
-rw-r--r--vendor/gix-features/src/zlib/stream/inflate.rs6
-rw-r--r--vendor/gix-features/tests/parallel/mod.rs2
-rw-r--r--vendor/gix-features/tests/pipe.rs2
17 files changed, 420 insertions, 99 deletions
diff --git a/vendor/gix-features/.cargo-checksum.json b/vendor/gix-features/.cargo-checksum.json
index 4d31feedf..653be24cb 100644
--- a/vendor/gix-features/.cargo-checksum.json
+++ b/vendor/gix-features/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"f5c5305ea0c5979c56a1287f7d66803d5c1e5ac7e4fed2b59798008224e8f3bd","Cargo.toml":"f94bac6d5704eaed7676650dee9ca97e501b7156f8bdd374b50009685ee85a54","src/cache.rs":"0ae91d58914d8e6ac2d2d6fa52522364db6ea8e81421614a36b4009a184a4705","src/decode.rs":"bf614320c6b69556da40d8412c73fb6a8648c80b7d75b9b2525eb62ac6c8d802","src/fs.rs":"6e034c04adaa55f34980b962bc1ee055a1921f12605a4c04d0401fbc69df033e","src/hash.rs":"95c5fe92beb1807b269bb86764c7ebb49363167a3d97931e06a20643b4c68f5e","src/interrupt.rs":"e9e91b50eadae55e4b2ca33482093697960a9dd4c3b7eaf7d1efb0dce495aa1e","src/io.rs":"6e4b80ce21d914e670629e9dbda13a8ebf0f523beb9036558236a94d00e88311","src/lib.rs":"e7ffd154849245bacb1f9c00e709b0b1c8d338755d7624507fbf3fd0adeffc0a","src/parallel/eager_iter.rs":"3bfb3e44478243afb7bfc68089c4c715131c2ce6d494450ce408001a28bf4dc9","src/parallel/in_order.rs":"a1c8c2f6ee4a91d6103f3fc6f27525e309cccc49ffc661d1403dbcdc57d120ad","src/parallel/in_parallel.rs":"d7182854eccf0f5d0af589f5efec02d0c14bbe9906920311e5d7516ddcc4fc31","src/parallel/mod.rs":"d74cf6da2ec807fbb34e75370470f34e5cbd9ae3440e5bac0d7def1167978521","src/parallel/reduce.rs":"3ed124c86af1860dbb07f01ad0249714955327c687bda7ee024cf3a3baf94186","src/parallel/serial.rs":"3cabe5acced4c0bbd79c71042c4fe71fb42bc8503416147bf7e94f14d1c66ebc","src/progress.rs":"4948deff70cdd6662936e2cc2908f39ade7bfb5981ba063f2e1b26d572ce1060","src/threading.rs":"241bec714a4ff6d94cf74804ac7e3ac172bda5394be799df4958740cf48e4bbb","src/zlib/mod.rs":"fd27b104abe2d93b71123e4f16640bc32703d6d09ba8e800c430dcfd72a07b06","src/zlib/stream/deflate/mod.rs":"8a69ea48012633f322e6bccc14dccaa29e8960bad7135f4abe924a38afc73c59","src/zlib/stream/deflate/tests.rs":"1a42b2c4fdbe8383d75ebdaae825c9ab0ac03a461e2177026e6be57c1101b37e","src/zlib/stream/inflate.rs":"d5bb3b858e42aecb263f2b24f110fffe22e94b507e963f156831868119dc3f20","src/zlib/stream/mod.rs":"0af2967eb75a07308c789a4187490cc7c36693b7f7d8a4f7705f3b4b90568f6f","tests/hash.rs":"d03f99e2ed1f00066e14212e7e65ee3ae076df42935d38c47d5a563b69367e8c","tests/parallel/in_order_iter.rs":"acd746c25929406748de5080b7ae5dcb2516269f037944d7aa84802520b885b4","tests/parallel/mod.rs":"c6b6d1b1db1a59f07fac93ed7ce10558a46eba38cfa3fc50659d3262ce58e313","tests/parallel_shared.rs":"5d8dabaa42fce087e2ec57843cfe69f2be1ca2fa3518030b5a31aeaa706675e0","tests/parallel_shared_threaded.rs":"5d8dabaa42fce087e2ec57843cfe69f2be1ca2fa3518030b5a31aeaa706675e0","tests/parallel_threaded.rs":"02cfb39c7e81bca7e92a851c731e993cad13eff87ec1f8a228d74761ec964f7a","tests/pipe.rs":"54c070bb8dc5f6b495131ff4342a715b0e6491a68d2477143eeb76b7d05f4019"},"package":"cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897"} \ No newline at end of file
+{"files":{"CHANGELOG.md":"b3ff4b92868658e951c1750f2b1dfe4969460c229d9a79256650418b26e2f9ad","Cargo.toml":"0a9a943dcceda741b94a60a322c4b9f0417c4c61117cd1abbfc44808aa96e3ab","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/cache.rs":"0ae91d58914d8e6ac2d2d6fa52522364db6ea8e81421614a36b4009a184a4705","src/decode.rs":"bf614320c6b69556da40d8412c73fb6a8648c80b7d75b9b2525eb62ac6c8d802","src/fs.rs":"c2a11f444b42ceffed0c1abfeb605bda8b00d847a5a06c38a20070dd94fe232b","src/hash.rs":"95c5fe92beb1807b269bb86764c7ebb49363167a3d97931e06a20643b4c68f5e","src/interrupt.rs":"e9e91b50eadae55e4b2ca33482093697960a9dd4c3b7eaf7d1efb0dce495aa1e","src/io.rs":"6e4b80ce21d914e670629e9dbda13a8ebf0f523beb9036558236a94d00e88311","src/lib.rs":"e7ffd154849245bacb1f9c00e709b0b1c8d338755d7624507fbf3fd0adeffc0a","src/parallel/eager_iter.rs":"3bfb3e44478243afb7bfc68089c4c715131c2ce6d494450ce408001a28bf4dc9","src/parallel/in_order.rs":"a1c8c2f6ee4a91d6103f3fc6f27525e309cccc49ffc661d1403dbcdc57d120ad","src/parallel/in_parallel.rs":"80d8e427e1430a33d0e02f42178dbb6906f914f050ad92919aad0ed11da48fba","src/parallel/mod.rs":"3bd76a28ab5ac6c956bc676c5eaf328772e0d21e9f8bb5a704a9963891d6ad89","src/parallel/reduce.rs":"3ed124c86af1860dbb07f01ad0249714955327c687bda7ee024cf3a3baf94186","src/parallel/serial.rs":"2879821c73c4326025e4ee2800ecf7d2e1d565b60c1acec6cbb3cb66d8eca826","src/progress.rs":"6760f64a133455cdafb55ff718900fa297b909556645909a4dfb15333a283fdd","src/threading.rs":"c98f8d203308ed089c845b15974be9b7566904b763a204cdd2c450b419ee1ddf","src/zlib/mod.rs":"720eebfa556bff56a9d90042d4c922f0be0259a9ff921b4f7edf1be0c09ae660","src/zlib/stream/deflate/mod.rs":"c712255c72fa74e2d79af27ad90905d3389e5f760c3f396d936f82906e7c1e14","src/zlib/stream/deflate/tests.rs":"c82d29bf27d1ba54cca4447a750bbaac94547a7ed4eb6e9a311600b8da9a63b8","src/zlib/stream/inflate.rs":"70bd552fe9f009990f656f6969d8ea5e646dee5b2432d5a62d3a5bca4e6ef02f","src/zlib/stream/mod.rs":"0af2967eb75a07308c789a4187490cc7c36693b7f7d8a4f7705f3b4b90568f6f","tests/hash.rs":"d03f99e2ed1f00066e14212e7e65ee3ae076df42935d38c47d5a563b69367e8c","tests/parallel/in_order_iter.rs":"acd746c25929406748de5080b7ae5dcb2516269f037944d7aa84802520b885b4","tests/parallel/mod.rs":"798b36204033558adb16f44d494e893ea593ef92d09418f8b84ac7cb4cf278af","tests/parallel_shared.rs":"5d8dabaa42fce087e2ec57843cfe69f2be1ca2fa3518030b5a31aeaa706675e0","tests/parallel_shared_threaded.rs":"5d8dabaa42fce087e2ec57843cfe69f2be1ca2fa3518030b5a31aeaa706675e0","tests/parallel_threaded.rs":"02cfb39c7e81bca7e92a851c731e993cad13eff87ec1f8a228d74761ec964f7a","tests/pipe.rs":"31429b2811278c5a0afcdc2c3f3229d5ccb8111ced69a806a71e5fa89773d495"},"package":"3a8c493409bf6060d408eec9bbdd1b12ea351266b50012e2a522f75dfc7b8314"} \ No newline at end of file
diff --git a/vendor/gix-features/CHANGELOG.md b/vendor/gix-features/CHANGELOG.md
index fb506811e..4634cc7f9 100644
--- a/vendor/gix-features/CHANGELOG.md
+++ b/vendor/gix-features/CHANGELOG.md
@@ -5,6 +5,70 @@ 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.30.0 (2023-06-06)
+
+### New Features
+
+ - <csr-id-d81b7e3036371d0a2a22f02a92df3c2b2950ff22/> add `zlib::Inflate::reset()`.
+ That way, each instance can be reused.
+ - <csr-id-add5ea8b83d00972b560536da82f9914ef6080d3/> make `prodash::RawProgress` available.
+ It's an object-safe version of the `Progress` trait.
+
+### New Features (BREAKING)
+
+ - <csr-id-0fa04bcbdf3102c5435e64cfef894a1bfc8d6e7b/> make current thread-count accessible in slice-workers.
+ Threads started for working on an entry in a slice can now see the amount
+ of threads left for use (and manipulate that variable) which effectively
+ allows them to implement their own parallelization on top of the current one.
+
+ This is useful if there is there is very imbalanced work within the slice itself.
+
+ While at it, we also make consumer functions mutable as they exsit per thread.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 19 commits contributed to the release over the course of 22 calendar days.
+ - 48 days passed between releases.
+ - 3 commits were understood as [conventional](https://www.conventionalcommits.org).
+ - 1 unique issue was worked on: [#851](https://github.com/Byron/gitoxide/issues/851)
+
+### Thanks Clippy
+
+<csr-read-only-do-not-edit/>
+
+[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic.
+
+### Commit Details
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **[#851](https://github.com/Byron/gitoxide/issues/851)**
+ - Make current thread-count accessible in slice-workers. ([`0fa04bc`](https://github.com/Byron/gitoxide/commit/0fa04bcbdf3102c5435e64cfef894a1bfc8d6e7b))
+ * **Uncategorized**
+ - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b))
+ - Merge branch 'integrate-gix-negotiate' ([`ae845de`](https://github.com/Byron/gitoxide/commit/ae845dea6cee6523c88a23d7a14293589cf8092f))
+ - Thanks clippy ([`9525ac8`](https://github.com/Byron/gitoxide/commit/9525ac822aa902f5325f17e7b08ffb60b683e0e7))
+ - Merge branch 'fix-alloc' ([`d9d9bc0`](https://github.com/Byron/gitoxide/commit/d9d9bc01b34ac75b28a5f1b75f40123aa6d83c60))
+ - Add `zlib::Inflate::reset()`. ([`d81b7e3`](https://github.com/Byron/gitoxide/commit/d81b7e3036371d0a2a22f02a92df3c2b2950ff22))
+ - Merge branch 'fix-docs' ([`420553a`](https://github.com/Byron/gitoxide/commit/420553a10d780e0b2dc466cac120989298a5f187))
+ - Cleaning up documentation ([`2578e57`](https://github.com/Byron/gitoxide/commit/2578e576bfa365d194a23a1fb0bf09be230873de))
+ - Merge branch 'auto-clippy' ([`dbf8aa1`](https://github.com/Byron/gitoxide/commit/dbf8aa19d19109195d0274928eae4b94f248cd88))
+ - Autofix map-or-unwrap clippy lint (and manual fix what was left) ([`2087032`](https://github.com/Byron/gitoxide/commit/2087032b5956dcd82bce6ac57e530e8724b57f17))
+ - Merge branch 'main' into auto-clippy ([`3ef5c90`](https://github.com/Byron/gitoxide/commit/3ef5c90aebce23385815f1df674c1d28d58b4b0d))
+ - Auto-fix clippy to remove explicit iter looping ([`3eff567`](https://github.com/Byron/gitoxide/commit/3eff567c683b5c650c14792b68968cbdbc90ec5c))
+ - Merge pull request #865 from nyurik/fix-tests ([`3a45973`](https://github.com/Byron/gitoxide/commit/3a45973c61c4816940b1c9bae4fe60af47a3f6c6))
+ - Merge branch 'blinxen/main' ([`9375cd7`](https://github.com/Byron/gitoxide/commit/9375cd75b01aa22a0e2eed6305fe45fabfd6c1ac))
+ - Include custom clippy settings ([`b057500`](https://github.com/Byron/gitoxide/commit/b057500dd3e6b75be3ebcd258cda0b946bedd9e1))
+ - Make cargo check to pass all tests ([`f4a44f7`](https://github.com/Byron/gitoxide/commit/f4a44f71e894dd8a08dd898a099b743a3ccff557))
+ - Include license files in all crates ([`facaaf6`](https://github.com/Byron/gitoxide/commit/facaaf633f01c857dcf2572c6dbe0a92b7105c1c))
+ - Merge branch 'fix-851' ([`2f275d5`](https://github.com/Byron/gitoxide/commit/2f275d5d3cb49b3b8ba53b30e4b4386fac32662b))
+ - Make `prodash::RawProgress` available. ([`add5ea8`](https://github.com/Byron/gitoxide/commit/add5ea8b83d00972b560536da82f9914ef6080d3))
+</details>
+
## 0.29.0 (2023-04-19)
### New Features (BREAKING)
@@ -15,7 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/>
- - 8 commits contributed to the release over the course of 6 calendar days.
+ - 9 commits contributed to the release over the course of 6 calendar days.
- 35 days passed between releases.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
@@ -27,6 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary>
* **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))
- Support native zlib-ng via flate2's zlib-ng feature ([`9a6e0d7`](https://github.com/Byron/gitoxide/commit/9a6e0d7b418ea721da6a7e4bc48c47b47d4dfa79))
- Merge branch 'main' into dev ([`23ee47f`](https://github.com/Byron/gitoxide/commit/23ee47fb24c197f8437bd426544b2aa74e005bdc))
diff --git a/vendor/gix-features/Cargo.toml b/vendor/gix-features/Cargo.toml
index bbb8b2030..3e5ebe852 100644
--- a/vendor/gix-features/Cargo.toml
+++ b/vendor/gix-features/Cargo.toml
@@ -10,15 +10,14 @@
# See Cargo.toml.orig for the original contents.
[package]
-edition = "2018"
+edition = "2021"
rust-version = "1.64"
name = "gix-features"
-version = "0.29.0"
+version = "0.30.0"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
description = "A crate to integrate various capabilities using compile-time feature flags"
license = "MIT/Apache-2.0"
repository = "https://github.com/Byron/gitoxide"
-resolver = "2"
[package.metadata.docs.rs]
all-features = true
@@ -89,7 +88,7 @@ optional = true
default-features = false
[dependencies.gix-hash]
-version = "^0.11.0"
+version = "^0.11.2"
[dependencies.jwalk]
version = "0.8.1"
@@ -105,7 +104,7 @@ optional = true
default-features = false
[dependencies.prodash]
-version = "23.1"
+version = "25.0.0"
optional = true
default-features = false
diff --git a/vendor/gix-features/LICENSE-APACHE b/vendor/gix-features/LICENSE-APACHE
new file mode 100644
index 000000000..a51f59a06
--- /dev/null
+++ b/vendor/gix-features/LICENSE-APACHE
@@ -0,0 +1,191 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ Copyright 2018-2021 Sebastian Thiel, and [contributors](https://github.com/byron/gitoxide/contributors)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/gix-features/LICENSE-MIT b/vendor/gix-features/LICENSE-MIT
new file mode 100644
index 000000000..b58e818f1
--- /dev/null
+++ b/vendor/gix-features/LICENSE-MIT
@@ -0,0 +1,21 @@
+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
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/gix-features/src/fs.rs b/vendor/gix-features/src/fs.rs
index f07ac1f0f..20d819547 100644
--- a/vendor/gix-features/src/fs.rs
+++ b/vendor/gix-features/src/fs.rs
@@ -38,19 +38,21 @@ pub mod walkdir {
match v {
Parallelism::Serial => jwalk::Parallelism::Serial,
Parallelism::ThreadPoolPerTraversal { thread_name } => std::thread::available_parallelism()
- .map(|threads| {
- let pool = jwalk::rayon::ThreadPoolBuilder::new()
- .num_threads(threads.get().min(16))
- .stack_size(128 * 1024)
- .thread_name(move |idx| format!("{thread_name} {idx}"))
- .build()
- .expect("we only set options that can't cause a build failure");
- jwalk::Parallelism::RayonExistingPool {
- pool: pool.into(),
- busy_timeout: None,
- }
- })
- .unwrap_or_else(|_| Parallelism::Serial.into()),
+ .map_or_else(
+ |_| Parallelism::Serial.into(),
+ |threads| {
+ let pool = jwalk::rayon::ThreadPoolBuilder::new()
+ .num_threads(threads.get().min(16))
+ .stack_size(128 * 1024)
+ .thread_name(move |idx| format!("{thread_name} {idx}"))
+ .build()
+ .expect("we only set options that can't cause a build failure");
+ jwalk::Parallelism::RayonExistingPool {
+ pool: pool.into(),
+ busy_timeout: None,
+ }
+ },
+ ),
}
}
}
diff --git a/vendor/gix-features/src/parallel/in_parallel.rs b/vendor/gix-features/src/parallel/in_parallel.rs
index e1e2cc3e3..241565b62 100644
--- a/vendor/gix-features/src/parallel/in_parallel.rs
+++ b/vendor/gix-features/src/parallel/in_parallel.rs
@@ -1,7 +1,10 @@
-use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering};
use crate::parallel::{num_threads, Reduce};
+/// A scope to start threads within.
+pub type Scope<'scope, 'env> = std::thread::Scope<'scope, 'env>;
+
/// Runs `left` and `right` in parallel, returning their output when both are done.
pub fn join<O1: Send, O2: Send>(left: impl FnOnce() -> O1 + Send, right: impl FnOnce() -> O2 + Send) -> (O1, O2) {
std::thread::scope(|s| {
@@ -47,7 +50,7 @@ pub fn in_parallel<I, S, O, R>(
input: impl Iterator<Item = I> + Send,
thread_limit: Option<usize>,
new_thread_state: impl Fn(usize) -> S + Send + Clone,
- consume: impl Fn(I, &mut S) -> O + Send + Clone,
+ consume: impl FnMut(I, &mut S) -> O + Send + Clone,
mut reducer: R,
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>
where
@@ -67,7 +70,7 @@ where
let send_result = send_result.clone();
let receive_input = receive_input.clone();
let new_thread_state = new_thread_state.clone();
- let consume = consume.clone();
+ let mut consume = consume.clone();
move || {
let mut state = new_thread_state(thread_id);
for item in receive_input {
@@ -103,12 +106,19 @@ where
/// This is only good for operations where near-random access isn't detrimental, so it's not usually great
/// for file-io as it won't make use of sorted inputs well.
/// Note that `periodic` is not guaranteed to be called in case other threads come up first and finish too fast.
+/// `consume(&mut item, &mut stat, &Scope, &threads_available, &should_interrupt)` is called for performing the actual computation.
+/// Note that `threads_available` should be decremented to start a thread that can steal your own work (as stored in `item`),
+/// which allows callees to implement their own work-stealing in case the work is distributed unevenly.
+/// Work stealing should only start after having processed at least one item to give all threads naturally operating on the slice
+/// some time to start. Starting threads while slice-workers are still starting up would lead to over-allocation of threads,
+/// which is why the number of threads left may turn negative. Once threads are started and stopped, be sure to adjust
+/// the thread-count accordingly.
// TODO: better docs
pub fn in_parallel_with_slice<I, S, R, E>(
input: &mut [I],
thread_limit: Option<usize>,
new_thread_state: impl FnMut(usize) -> S + Send + Clone,
- consume: impl FnMut(&mut I, &mut S) -> Result<(), E> + Send + Clone,
+ consume: impl FnMut(&mut I, &mut S, &AtomicIsize, &AtomicBool) -> Result<(), E> + Send + Clone,
mut periodic: impl FnMut() -> Option<std::time::Duration> + Send,
state_to_rval: impl FnOnce(S) -> R + Send + Clone,
) -> Result<Vec<R>, E>
@@ -121,8 +131,8 @@ where
let mut results = Vec::with_capacity(num_threads);
let stop_everything = &AtomicBool::default();
let index = &AtomicUsize::default();
+ let threads_left = &AtomicIsize::new(num_threads as isize);
- // TODO: use std::thread::scope() once Rust 1.63 is available.
std::thread::scope({
move |s| {
std::thread::Builder::new()
@@ -163,29 +173,35 @@ where
let mut consume = consume.clone();
let input = Input(input as *mut [I]);
move || {
+ let _ = &input;
+ threads_left.fetch_sub(1, Ordering::SeqCst);
let mut state = new_thread_state(thread_id);
- while let Ok(input_index) =
- index.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
- (x < input_len).then_some(x + 1)
- })
- {
- if stop_everything.load(Ordering::Relaxed) {
- break;
- }
- // SAFETY: our atomic counter for `input_index` is only ever incremented, yielding
- // each item exactly once.
- let item = {
- #[allow(unsafe_code)]
- unsafe {
- &mut (&mut *input.0)[input_index]
+ let res = (|| {
+ while let Ok(input_index) =
+ index.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
+ (x < input_len).then_some(x + 1)
+ })
+ {
+ if stop_everything.load(Ordering::Relaxed) {
+ break;
+ }
+ // SAFETY: our atomic counter for `input_index` is only ever incremented, yielding
+ // each item exactly once.
+ let item = {
+ #[allow(unsafe_code)]
+ unsafe {
+ &mut (&mut *input.0)[input_index]
+ }
+ };
+ if let Err(err) = consume(item, &mut state, threads_left, stop_everything) {
+ stop_everything.store(true, Ordering::Relaxed);
+ return Err(err);
}
- };
- if let Err(err) = consume(item, &mut state) {
- stop_everything.store(true, Ordering::Relaxed);
- return Err(err);
}
- }
- Ok(state_to_rval(state))
+ Ok(state_to_rval(state))
+ })();
+ threads_left.fetch_add(1, Ordering::SeqCst);
+ res
}
})
.expect("valid name")
diff --git a/vendor/gix-features/src/parallel/mod.rs b/vendor/gix-features/src/parallel/mod.rs
index c994cb3b8..ac644acdd 100644
--- a/vendor/gix-features/src/parallel/mod.rs
+++ b/vendor/gix-features/src/parallel/mod.rs
@@ -1,12 +1,12 @@
//! Run computations in parallel, or not based the `parallel` feature toggle.
//!
-//! ### in_parallel(…)
+//! ### `in_parallel`(…)
//!
//! The [`in_parallel(…)`][in_parallel()] is the typical fan-out-fan-in mode of parallelism, with thread local storage
//! made available to a `consume(…)` function to process input. The result is sent to the [`Reduce`] running in the calling
//! thread to aggregate the results into a single output, which is returned by [`in_parallel()`].
//!
-//! Interruptions can be achieved by letting the reducers [`feed(…)`][Reduce::feed()]` method fail.
+//! Interruptions can be achieved by letting the reducers [`feed(…)`][Reduce::feed()] method fail.
//!
//! It gets a boost in usability as it allows threads to borrow variables from the stack, most commonly the repository itself
//! or the data to work on.
@@ -35,11 +35,11 @@
#[cfg(feature = "parallel")]
mod in_parallel;
#[cfg(feature = "parallel")]
-pub use in_parallel::{build_thread, in_parallel, in_parallel_with_slice, join, threads};
+pub use in_parallel::{build_thread, in_parallel, in_parallel_with_slice, join, threads, Scope};
mod serial;
#[cfg(not(feature = "parallel"))]
-pub use serial::{build_thread, in_parallel, in_parallel_with_slice, join, threads};
+pub use serial::{build_thread, in_parallel, in_parallel_with_slice, join, threads, Scope};
mod in_order;
pub use in_order::{InOrderIter, SequenceId};
@@ -80,13 +80,21 @@ pub fn optimize_chunk_size_and_thread_limit(
) -> (usize, Option<usize>, usize) {
let available_threads =
available_threads.unwrap_or_else(|| std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1));
- let available_threads = thread_limit
- .map(|l| if l == 0 { available_threads } else { l })
- .unwrap_or(available_threads);
+ let available_threads = thread_limit.map_or(available_threads, |l| if l == 0 { available_threads } else { l });
let (lower, upper) = (50, 1000);
- let (chunk_size, thread_limit) = num_items
- .map(|num_items| {
+ let (chunk_size, thread_limit) = num_items.map_or(
+ {
+ let chunk_size = if available_threads == 1 {
+ desired_chunk_size
+ } else if desired_chunk_size < lower {
+ lower
+ } else {
+ desired_chunk_size.min(upper)
+ };
+ (chunk_size, available_threads)
+ },
+ |num_items| {
let desired_chunks_per_thread_at_least = 2;
let items = num_items;
let chunk_size = (items / (available_threads * desired_chunks_per_thread_at_least)).clamp(1, upper);
@@ -97,17 +105,8 @@ pub fn optimize_chunk_size_and_thread_limit(
available_threads
};
(chunk_size, thread_limit)
- })
- .unwrap_or({
- let chunk_size = if available_threads == 1 {
- desired_chunk_size
- } else if desired_chunk_size < lower {
- lower
- } else {
- desired_chunk_size.min(upper)
- };
- (chunk_size, available_threads)
- });
+ },
+ );
(chunk_size, Some(thread_limit), thread_limit)
}
@@ -123,9 +122,7 @@ pub fn num_threads(_thread_limit: Option<usize>) -> usize {
#[cfg(feature = "parallel")]
pub fn num_threads(thread_limit: Option<usize>) -> usize {
let logical_cores = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
- thread_limit
- .map(|l| if l == 0 { logical_cores } else { l })
- .unwrap_or(logical_cores)
+ thread_limit.map_or(logical_cores, |l| if l == 0 { logical_cores } else { l })
}
/// Run [`in_parallel()`] only if the given `condition()` returns true when eagerly evaluated.
@@ -137,7 +134,7 @@ pub fn in_parallel_if<I, S, O, R>(
input: impl Iterator<Item = I> + Send,
thread_limit: Option<usize>,
new_thread_state: impl Fn(usize) -> S + Send + Clone,
- consume: impl Fn(I, &mut S) -> O + Send + Clone,
+ consume: impl FnMut(I, &mut S) -> O + Send + Clone,
reducer: R,
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>
where
@@ -163,7 +160,7 @@ pub fn in_parallel_if<I, S, O, R>(
input: impl Iterator<Item = I>,
thread_limit: Option<usize>,
new_thread_state: impl Fn(usize) -> S,
- consume: impl Fn(I, &mut S) -> O,
+ consume: impl FnMut(I, &mut S) -> O,
reducer: R,
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>
where
diff --git a/vendor/gix-features/src/parallel/serial.rs b/vendor/gix-features/src/parallel/serial.rs
index 00723b2c3..3511c73e3 100644
--- a/vendor/gix-features/src/parallel/serial.rs
+++ b/vendor/gix-features/src/parallel/serial.rs
@@ -2,14 +2,17 @@ use crate::parallel::Reduce;
#[cfg(not(feature = "parallel"))]
mod not_parallel {
+ use std::sync::atomic::{AtomicBool, AtomicIsize};
+
/// Runs `left` and then `right`, one after another, returning their output when both are done.
pub fn join<O1, O2>(left: impl FnOnce() -> O1, right: impl FnOnce() -> O2) -> (O1, O2) {
(left(), right())
}
/// A scope for spawning threads.
- pub struct Scope<'env> {
- _marker: std::marker::PhantomData<&'env mut &'env ()>,
+ pub struct Scope<'scope, 'env: 'scope> {
+ _scope: std::marker::PhantomData<&'scope mut &'scope ()>,
+ _env: std::marker::PhantomData<&'env mut &'env ()>,
}
pub struct ThreadBuilder;
@@ -20,32 +23,31 @@ mod not_parallel {
}
#[allow(unsafe_code)]
- unsafe impl Sync for Scope<'_> {}
+ unsafe impl Sync for Scope<'_, '_> {}
impl ThreadBuilder {
pub fn name(self, _new: String) -> Self {
self
}
- pub fn spawn_scoped<'a, 'env, F, T>(
+ pub fn spawn_scoped<'scope, 'env, F, T>(
&self,
- scope: &'a Scope<'env>,
+ scope: &'scope Scope<'scope, 'env>,
f: F,
- ) -> std::io::Result<ScopedJoinHandle<'a, T>>
+ ) -> std::io::Result<ScopedJoinHandle<'scope, T>>
where
- F: FnOnce() -> T,
- F: Send + 'env,
- T: Send + 'env,
+ F: FnOnce() -> T + 'scope,
+ T: 'scope,
{
Ok(scope.spawn(f))
}
}
- impl<'env> Scope<'env> {
- pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T>
+ impl<'scope, 'env> Scope<'scope, 'env> {
+ /// Provided with this scope, let `f` start new threads that live within it.
+ pub fn spawn<F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T>
where
- F: FnOnce() -> T,
- F: Send + 'env,
- T: Send + 'env,
+ F: FnOnce() -> T + 'scope,
+ T: 'scope,
{
ScopedJoinHandle {
result: f(),
@@ -58,10 +60,11 @@ mod not_parallel {
/// Note that this implementation will run the spawned functions immediately.
pub fn threads<'env, F, R>(f: F) -> R
where
- F: FnOnce(&Scope<'env>) -> R,
+ F: for<'scope> FnOnce(&'scope Scope<'scope, 'env>) -> R,
{
f(&Scope {
- _marker: Default::default(),
+ _scope: Default::default(),
+ _env: Default::default(),
})
}
@@ -79,6 +82,9 @@ mod not_parallel {
pub fn join(self) -> std::thread::Result<T> {
Ok(self.result)
}
+ pub fn is_finished(&self) -> bool {
+ true
+ }
}
/// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state.
@@ -89,13 +95,15 @@ mod not_parallel {
input: &mut [I],
_thread_limit: Option<usize>,
mut new_thread_state: impl FnMut(usize) -> S + Clone,
- mut consume: impl FnMut(&mut I, &mut S) -> Result<(), E> + Clone,
+ mut consume: impl FnMut(&mut I, &mut S, &AtomicIsize, &AtomicBool) -> Result<(), E> + Clone,
mut periodic: impl FnMut() -> Option<std::time::Duration>,
state_to_rval: impl FnOnce(S) -> R + Clone,
) -> Result<Vec<R>, E> {
let mut state = new_thread_state(0);
+ let should_interrupt = &AtomicBool::default();
+ let threads_left = &AtomicIsize::default();
for item in input {
- consume(item, &mut state)?;
+ consume(item, &mut state, threads_left, should_interrupt)?;
if periodic().is_none() {
break;
}
@@ -121,7 +129,7 @@ pub fn in_parallel<I, S, O, R>(
input: impl Iterator<Item = I>,
_thread_limit: Option<usize>,
new_thread_state: impl Fn(usize) -> S,
- consume: impl Fn(I, &mut S) -> O,
+ mut consume: impl FnMut(I, &mut S) -> O,
mut reducer: R,
) -> Result<<R as Reduce>::Output, <R as Reduce>::Error>
where
diff --git a/vendor/gix-features/src/progress.rs b/vendor/gix-features/src/progress.rs
index b7aeda620..8d1e30bc4 100644
--- a/vendor/gix-features/src/progress.rs
+++ b/vendor/gix-features/src/progress.rs
@@ -7,7 +7,7 @@ pub use prodash::{
self,
messages::MessageLevel,
progress::{Discard, DoOrDiscard, Either, Id, Step, StepShared, Task, ThroughputOnDrop, Value, UNKNOWN},
- unit, Progress, Unit,
+ unit, Progress, RawProgress, Unit,
};
/// A stub for the portions of the `bytesize` crate that we use internally in `gitoxide`.
#[cfg(not(feature = "progress-unit-bytes"))]
diff --git a/vendor/gix-features/src/threading.rs b/vendor/gix-features/src/threading.rs
index ff0c819a5..2b33386d2 100644
--- a/vendor/gix-features/src/threading.rs
+++ b/vendor/gix-features/src/threading.rs
@@ -17,7 +17,7 @@ mod _impl {
pub type Mutable<T> = parking_lot::Mutex<T>;
/// A guarded reference suitable for safekeeping in a struct.
pub type RefGuard<'a, T> = parking_lot::RwLockReadGuard<'a, T>;
- /// A mapped reference created from a RefGuard
+ /// A mapped reference created from a `RefGuard`
pub type MappedRefGuard<'a, U> = parking_lot::MappedRwLockReadGuard<'a, U>;
/// Get a shared reference through a [`MutableOnDemand`] for read-only access.
diff --git a/vendor/gix-features/src/zlib/mod.rs b/vendor/gix-features/src/zlib/mod.rs
index 8dcdfd93f..f55660075 100644
--- a/vendor/gix-features/src/zlib/mod.rs
+++ b/vendor/gix-features/src/zlib/mod.rs
@@ -41,6 +41,11 @@ impl Inflate {
(self.state.total_out() - before_out) as usize,
))
}
+
+ /// Ready this instance for decoding another data stream.
+ pub fn reset(&mut self) {
+ self.state.reset(true);
+ }
}
///
diff --git a/vendor/gix-features/src/zlib/stream/deflate/mod.rs b/vendor/gix-features/src/zlib/stream/deflate/mod.rs
index 55f575ea4..567e8fece 100644
--- a/vendor/gix-features/src/zlib/stream/deflate/mod.rs
+++ b/vendor/gix-features/src/zlib/stream/deflate/mod.rs
@@ -11,6 +11,19 @@ pub struct Write<W> {
buf: [u8; BUF_SIZE],
}
+impl<W> Clone for Write<W>
+where
+ W: Clone,
+{
+ fn clone(&self) -> Self {
+ Write {
+ compressor: impls::new_compress(),
+ inner: self.inner.clone(),
+ buf: self.buf,
+ }
+ }
+}
+
mod impls {
use std::io;
@@ -18,6 +31,10 @@ mod impls {
use crate::zlib::stream::deflate;
+ pub(crate) fn new_compress() -> Compress {
+ Compress::new(Compression::fast(), true)
+ }
+
impl<W> deflate::Write<W>
where
W: io::Write,
@@ -25,7 +42,7 @@ mod impls {
/// Create a new instance writing compressed bytes to `inner`.
pub fn new(inner: W) -> deflate::Write<W> {
deflate::Write {
- compressor: Compress::new(Compression::fast(), true),
+ compressor: new_compress(),
inner,
buf: [0; deflate::BUF_SIZE],
}
diff --git a/vendor/gix-features/src/zlib/stream/deflate/tests.rs b/vendor/gix-features/src/zlib/stream/deflate/tests.rs
index ba0dd2a2c..7c5865e0b 100644
--- a/vendor/gix-features/src/zlib/stream/deflate/tests.rs
+++ b/vendor/gix-features/src/zlib/stream/deflate/tests.rs
@@ -75,7 +75,7 @@ mod deflate_stream {
fn big_file_small_writes() -> Result<(), Box<dyn std::error::Error>> {
let mut w = deflate::Write::new(Vec::new());
let bytes = include_bytes!(
- "../../../../tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
+ "../../../../../gix-odb/tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
);
for chunk in bytes.chunks(2) {
assert_eq!(w.write(chunk)?, chunk.len());
@@ -89,7 +89,7 @@ mod deflate_stream {
fn big_file_a_few_big_writes() -> Result<(), Box<dyn std::error::Error>> {
let mut w = deflate::Write::new(Vec::new());
let bytes = include_bytes!(
- "../../../../tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
+ "../../../../../gix-odb/tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
);
for chunk in bytes.chunks(4096 * 9) {
assert_eq!(w.write(chunk)?, chunk.len());
diff --git a/vendor/gix-features/src/zlib/stream/inflate.rs b/vendor/gix-features/src/zlib/stream/inflate.rs
index 007ecedc6..f68f45f57 100644
--- a/vendor/gix-features/src/zlib/stream/inflate.rs
+++ b/vendor/gix-features/src/zlib/stream/inflate.rs
@@ -46,11 +46,11 @@ pub fn read(rd: &mut impl BufRead, state: &mut Decompress, mut dst: &mut [u8]) -
// The stream has officially ended, nothing more to do here.
Ok(Status::StreamEnd) => return Ok(total_written),
// Either input our output are depleted even though the stream is not depleted yet.
- Ok(Status::Ok) | Ok(Status::BufError) if eof || dst.is_empty() => return Ok(total_written),
+ Ok(Status::Ok | Status::BufError) if eof || dst.is_empty() => return Ok(total_written),
// Some progress was made in both the input and the output, it must continue to reach the end.
- Ok(Status::Ok) | Ok(Status::BufError) if consumed != 0 || written != 0 => continue,
+ Ok(Status::Ok | Status::BufError) if consumed != 0 || written != 0 => continue,
// A strange state, where zlib makes no progress but isn't done either. Call it out.
- Ok(Status::Ok) | Ok(Status::BufError) => unreachable!("Definitely a bug somewhere"),
+ Ok(Status::Ok | Status::BufError) => unreachable!("Definitely a bug somewhere"),
Err(..) => return Err(io::Error::new(io::ErrorKind::InvalidInput, "corrupt deflate stream")),
}
}
diff --git a/vendor/gix-features/tests/parallel/mod.rs b/vendor/gix-features/tests/parallel/mod.rs
index b4b4236f8..cc824332d 100644
--- a/vendor/gix-features/tests/parallel/mod.rs
+++ b/vendor/gix-features/tests/parallel/mod.rs
@@ -45,7 +45,7 @@ fn in_parallel_with_mut_slice_in_chunks() {
&mut input,
None,
|_| 0usize,
- |item, acc| {
+ |item, acc, _threads_eft, _should_interrupt| {
*acc += *item;
*item += 1;
Ok::<_, ()>(())
diff --git a/vendor/gix-features/tests/pipe.rs b/vendor/gix-features/tests/pipe.rs
index 4815000bf..f2055ea9e 100644
--- a/vendor/gix-features/tests/pipe.rs
+++ b/vendor/gix-features/tests/pipe.rs
@@ -49,7 +49,7 @@ mod io {
writer.write_all(b"b\nc\n").expect("success");
drop(writer);
assert_eq!(
- reader.lines().flat_map(Result::ok).collect::<Vec<_>>(),
+ reader.lines().map_while(Result::ok).collect::<Vec<_>>(),
vec!["a", "b", "c"]
)
}