diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..03194e2b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# Dependabot dependency version checks / updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "daily" + rebase-strategy: "disabled" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + rebase-strategy: "disabled" diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index cf78c4f0..00000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: audit - -env: - RUST_BACKTRACE: 1 - -jobs: - audit: - name: cargo audit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - -on: - push: - branches: [staging, trying] - pull_request: - branches: [prīmum] diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index ca5cc798..b25d28c9 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -8,12 +8,9 @@ jobs: name: cargo test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --locked --all-features + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo --locked test --workspace --all-features on: push: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e9a9ecfe..de31745d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,19 +8,12 @@ jobs: name: codecov runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/tarpaulin@v0.1 - with: - version: 0.13.3 # v0.14.0 has issues with time v0.2.16 - args: - --locked - --all-features - -- - --skip 'proptest::' - - uses: codecov/codecov-action@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: taiki-e/cache-cargo-install-action@v1 + with: { tool: cargo-tarpaulin } + - run: cargo --locked tarpaulin --all-features -- --skip 'proptest::' + - uses: codecov/codecov-action@v3 on: push: diff --git a/.github/workflows/deny.yml b/.github/workflows/deny.yml new file mode 100644 index 00000000..1235d12e --- /dev/null +++ b/.github/workflows/deny.yml @@ -0,0 +1,30 @@ +name: deny + +env: + RUST_BACKTRACE: 1 + +jobs: + cargo-deny-advisories: + name: cargo deny advisories + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check advisories + + cargo-deny-licenses: + name: cargo deny bans licenses sources + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check bans licenses sources + +on: + push: + branches: [staging, trying] + pull_request: + branches: [prīmum] diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 141c73fe..a43f02d9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,15 +10,11 @@ jobs: env: RUSTDOCFLAGS: '--cfg=docsrs -Dwarnings' steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rust-version: nightly - - uses: actions-rs/cargo@v1 - with: - command: doc toolchain: nightly - args: --all-features --no-deps + - run: cargo doc --all-features --no-deps on: push: diff --git a/.github/workflows/exhaustive.yml b/.github/workflows/exhaustive.yml index f6ca7ff2..a82a563e 100644 --- a/.github/workflows/exhaustive.yml +++ b/.github/workflows/exhaustive.yml @@ -16,22 +16,18 @@ jobs: - { toolchain: stable, target: x86_64-unknown-linux-gnu, os: ubuntu-latest } runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: ${{ matrix.platform.toolchain }} - targets: ${{ matrix.platform.target }} - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: ${{ matrix.platform.toolchain }} - command: test - args: --all --locked --all-features + target: ${{ matrix.platform.target }} + - run: cargo --locked test --all --all-features min-versions: name: cargo test --shallow-minimal-versions runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hecrj/setup-rust-action@v1 with: rust-version: nightly @@ -53,10 +49,7 @@ jobs: - uses: hecrj/setup-rust-action@v1 with: rust-version: stable - - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --locked --all-features + - run: cargo --locked test --workspace --all-features check-features: name: cargo hack check --feature-powerset @@ -64,16 +57,12 @@ jobs: env: RUSTFLAGS: -Dwarnings steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-hack - - uses: actions-rs/cargo@v1 - with: - command: hack - args: check + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: taiki-e/cache-cargo-install-action@v1 + with: { tool: cargo-hack } + - run: + cargo hack check --workspace --feature-powerset --no-dev-deps @@ -85,16 +74,12 @@ jobs: env: RUSTFLAGS: -Dwarnings steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-hack - - uses: actions-rs/cargo@v1 - with: - command: hack - args: check + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: taiki-e/cache-cargo-install-action@v1 + with: { tool: cargo-hack } + - run: + cargo hack check --workspace --feature-powerset --all-targets diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 99af97fb..354bf438 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,25 +8,19 @@ jobs: name: cargo fmt --check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: { components: rustfmt } - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: cargo fmt --all -- --check clippy: name: cargo clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: { components: clippy } - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all --all-targets --all-features --locked -- -D warnings + - run: cargo --locked clippy --all --all-targets --all-features -- -D warnings on: push: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3cba2477..46eb6fb0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,45 +8,33 @@ jobs: name: cargo +nightly test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: nightly - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly - command: test - args: --all --locked --all-features + - run: cargo --locked test --all --all-features fmt: name: cargo +nightly fmt --check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: nightly - components: rustfmt - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly - command: fmt - args: --all -- --check + components: rustfmt + - run: cargo fmt --all -- --check clippy: name: cargo +nightly clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: nightly - components: clippy - - uses: actions-rs/cargo@v1 + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly - command: clippy - args: --all --all-targets --all-features --locked -- -D warnings + components: clippy + - run: cargo --locked clippy --all --all-targets --all-features -- -D warnings on: schedule: diff --git a/Cargo.lock b/Cargo.lock index d00847ec..85f9c595 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "alloc-no-stdlib" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192ec435945d87bc2f70992b4d818154b5feede43c09fb7592146374eac90a6" +checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" [[package]] name = "alloc-stdlib" @@ -25,32 +25,31 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.8" +version = "0.3.15" dependencies = [ "brotli", "bytes 0.5.6", "bytes 0.6.0", - "bytes 1.0.1", + "bytes 1.1.0", "bzip2", "flate2", "futures", "futures-core", "futures-io", "futures-test", - "futures_codec", "memchr", "ntest", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.8", "proptest", "proptest-derive", - "rand 0.7.3", + "rand", "tokio 0.2.25", "tokio 0.3.7", - "tokio 1.5.0", + "tokio 1.24.2", "tokio-util 0.3.1", "tokio-util 0.4.0", "tokio-util 0.5.1", - "tokio-util 0.6.6", + "tokio-util 0.6.9", "xz2", "zstd", "zstd-safe", @@ -58,15 +57,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bit-set" @@ -85,15 +78,15 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "brotli" -version = "3.3.0" +version = "3.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f29919120f08613aadcd4383764e00526fc9f18b6c0895814faeed0dd78613e" +checksum = "f838e47a451d5a8fa552371f80024dd6ace9b7acdf25c4c3d0f9bc6816fb1c39" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -102,9 +95,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1052e1c3b8d4d80eb84a8b94f0a1498797b5fb96314c001156a1c761940ef4ec" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -130,15 +123,15 @@ checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" [[package]] name = "bytes" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "bzip2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8012c8a15d5df745fcf258d93e6149dcf102882c8d8702d9cff778eab43a8" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" dependencies = [ "bzip2-sys", "libc", @@ -146,9 +139,9 @@ dependencies = [ [[package]] name = "bzip2-sys" -version = "0.1.10+1.0.8" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ "cc", "libc", @@ -157,9 +150,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" dependencies = [ "jobserver", ] @@ -171,28 +164,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cloudabi" -version = "0.0.3" +name = "crc32fast" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" dependencies = [ - "bitflags", + "cfg-if", ] [[package]] -name = "crc32fast" -version = "1.2.1" +name = "errno" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ - "cfg-if", + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", ] [[package]] name = "flate2" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ "cfg-if", "crc32fast", @@ -206,17 +220,11 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253" +checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" dependencies = [ "futures-channel", "futures-core", @@ -229,9 +237,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25" +checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" dependencies = [ "futures-core", "futures-sink", @@ -239,15 +247,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815" +checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" [[package]] name = "futures-executor" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d" +checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" dependencies = [ "futures-core", "futures-task", @@ -256,55 +264,55 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04" +checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" [[package]] name = "futures-macro" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668c6733a182cd7deb4f1de7ba3bf2120823835b3bcfbeacf7d2c4a773c1bb8b" +checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] name = "futures-sink" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23" +checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" [[package]] name = "futures-task" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7aa51095076f3ba6d9a1f702f74bd05ec65f555d70d2033d55ba8d69f581bc" +checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" [[package]] name = "futures-test" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77baeade98824bc928c21b8ad39918b9d8a06745ebdb6e2c93fb7673fb7968d" +checksum = "4e741bc851e1e90ad08901b329389ae77e02d5e9a0ec61955b80834630fbdc2f" dependencies = [ "futures-core", "futures-executor", "futures-io", + "futures-macro", "futures-sink", "futures-task", "futures-util", - "pin-project 1.0.7", + "pin-project", "pin-utils", ] [[package]] name = "futures-util" -version = "0.3.14" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025" +checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" dependencies = [ "futures-channel", "futures-core", @@ -313,52 +321,53 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.8", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] -name = "futures_codec" -version = "0.4.1" +name = "getrandom" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ - "bytes 0.5.6", - "futures", - "memchr", - "pin-project 0.4.28", + "cfg-if", + "libc", + "wasi", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] -name = "getrandom" -version = "0.2.2" +name = "io-lifetimes" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ - "cfg-if", + "hermit-abi", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "windows-sys 0.48.0", ] [[package]] name = "jobserver" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] @@ -371,9 +380,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.93" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "log" @@ -397,9 +412,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "miniz_oxide" @@ -408,14 +423,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", - "autocfg 1.0.1", + "autocfg", ] [[package]] name = "ntest" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "984caf6c8aa869418ef88062fc685d07d50c04308e63f7eaff6a395b1f5aff33" +checksum = "e865500b46e35210765d62d549178c520badc018b2a71a827c29b305d680d1fb" dependencies = [ "ntest_proc_macro_helper", "ntest_test_cases", @@ -424,32 +439,32 @@ dependencies = [ [[package]] name = "ntest_proc_macro_helper" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115562228962147ca51748d19446a4261535a7b6a7b5ff02681e527dcefc22f7" +checksum = "a0e328d267a679d683b55222b3d06c2fb7358220857945bfc4e65a6b531e9994" [[package]] name = "ntest_test_cases" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03e3201148714c580c5cf1ef68b1ed4039203068193197834a43503164b8237" +checksum = "6f7caf063242bb66721e74515dc01a915901063fa1f994bee7a2b9136f13370e" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] name = "ntest_timeout" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a870300c30d4224cb16022a4660fd8084d6cb4d29618563c3016b50cc757d1e7" +checksum = "bca6eaadc7c104fb2eb0c6d14782b9e33775aaf5584c3bcb0f87c89e3e6d6c07" dependencies = [ "ntest_proc_macro_helper", "proc-macro-crate", - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -458,47 +473,27 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", -] - -[[package]] -name = "pin-project" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" -dependencies = [ - "pin-project-internal 0.4.28", + "autocfg", ] [[package]] name = "pin-project" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ - "pin-project-internal 1.0.7", + "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.28" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" -dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -509,9 +504,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -521,37 +516,26 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ + "thiserror", "toml", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" version = "0.4.30" @@ -563,27 +547,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ - "unicode-xid 0.2.1", + "unicode-xid 0.2.2", ] [[package]] name = "proptest" -version = "0.9.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c477819b845fe023d33583ebf10c9f62518c8d79a0960ba5c36d6ac8a55a5b" +checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" dependencies = [ "bit-set", "bitflags", "byteorder", "lazy_static", "num-traits", - "quick-error", - "rand 0.6.5", - "rand_chacha 0.1.1", + "quick-error 2.0.1", + "rand", + "rand_chacha", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -592,9 +576,9 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.1.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31edb17edac73aeacc947bd61462dda15220584268896a58e12f053d767f15b" +checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", @@ -607,6 +591,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quote" version = "0.6.13" @@ -618,256 +608,104 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ - "proc-macro2 1.0.26", + "proc-macro2 1.0.36", ] [[package]] name = "rand" -version = "0.6.5" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "autocfg 0.1.7", "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha 0.3.0", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_chacha", + "rand_core", ] [[package]] name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.2", -] - -[[package]] -name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "getrandom 0.1.16", + "ppv-lite86", + "rand_core", ] [[package]] name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" -dependencies = [ - "getrandom 0.2.2", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core 0.6.2", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", + "getrandom", ] [[package]] name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.3.1", + "rand_core", ] [[package]] name = "redox_syscall" -version = "0.2.6" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8270314b5ccceb518e7e578952f0b72b88222d02e8f77f5ecf7abbb673539041" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "rustix" +version = "0.36.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "3a38f9520be93aba504e8ca974197f46158de5dcaa9fa04b57c57cd6a679d658" dependencies = [ - "winapi", + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", ] [[package]] name = "rusty-fork" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd93264e10c577503e926bd1430193eeb5d21b059148910082245309b424fae" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] [[package]] name = "serde" -version = "1.0.125" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" +checksum = "2cf9235533494ea2ddcdb794665461814781c53f19d87b76e571a1c35acbad2b" [[package]] name = "slab" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "syn" @@ -882,27 +720,46 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.70" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9505f307c872bab8eb46f77ae357c8eba1fdacead58ee5a850116b1d7f82883" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "unicode-xid 0.2.1", + "proc-macro2 1.0.36", + "quote 1.0.15", + "unicode-xid 0.2.2", ] [[package]] name = "tempfile" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", - "libc", - "rand 0.8.3", + "fastrand", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.42.0", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -925,23 +782,24 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46409491c9375a693ce7032101970a54f8a2010efb77e13f70788f0d84489e39" dependencies = [ - "autocfg 1.0.1", + "autocfg", "bytes 0.6.0", "futures-core", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.8", ] [[package]] name = "tokio" -version = "1.5.0" +version = "1.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f0c8e7c0addab50b663055baf787d0af7f413a46e6e7fb9559a4e4db7137a5" +checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" dependencies = [ - "autocfg 1.0.1", - "bytes 1.0.1", + "autocfg", + "bytes 1.1.0", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.8", + "windows-sys 0.42.0", ] [[package]] @@ -950,9 +808,9 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn 1.0.70", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", ] [[package]] @@ -993,22 +851,22 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.8", "tokio 0.3.7", ] [[package]] name = "tokio-util" -version = "0.6.6" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940a12c99365c31ea8dd9ba04ec1be183ffe4920102bb7122c2f515437601e8e" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ - "bytes 1.0.1", + "bytes 1.1.0", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.6", - "tokio 1.5.0", + "pin-project-lite 0.2.8", + "tokio 1.24.2", ] [[package]] @@ -1028,9 +886,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "wait-timeout" @@ -1043,37 +901,156 @@ dependencies = [ [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +name = "windows-sys" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] [[package]] -name = "winapi" -version = "0.3.9" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-targets 0.42.2", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "xz2" @@ -1086,18 +1063,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.8.3+zstd.1.5.0" +version = "0.11.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea7094c7b4a58fbd738eb0d4a2fc7684a0e6949a31597e074ffe20a07cbc2bf" +checksum = "77a16b8414fde0414e90c612eba70985577451c4c504b99885ebed24762cb81a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.0+zstd.1.5.0" +version = "5.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30375f78e185ca4c91930f42ea2c0162f9aa29737032501f93b79266d985ae7" +checksum = "7c12659121420dd6365c5c3de4901f97145b79651fb1d25814020ed2ed0585ae" dependencies = [ "libc", "zstd-sys", @@ -1105,9 +1082,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.0+zstd.1.5.0" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2141bed8922b427761470e6bbfeff255da94fa20b0bbeab0d9297fcaf71e3aa7" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 33cee879..8e9b0823 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-compression" -version = "0.3.8" +version = "0.3.15" authors = ["Wim Looman ", "Allen Bui "] edition = "2018" license = "MIT OR Apache-2.0" @@ -37,27 +37,27 @@ futures-write = ["futures-io"] [dependencies] xz2 = { version = "0.1.6", optional = true } -brotli = { version = "3.3.0", optional = true } +brotli = { version = "3.3.0", optional = true, default-features = false, features = ["std"] } bytes-05 = { package = "bytes", version = "0.5.0", optional = true } bzip2 = { version = "0.4.1" , optional = true } flate2 = { version = "1.0.11", optional = true } futures-core = { version = "0.3.0", default-features = false } futures-io = { version = "0.3.0", default-features = false, features = ["std"], optional = true } pin-project-lite = "0.2.0" -libzstd = { package = "zstd", version = "0.8.3", optional = true, default-features = false } -zstd-safe = { version = "4.1.0", optional = true, default-features = false } +libzstd = { package = "zstd", version = "0.11.1", optional = true, default-features = false } +zstd-safe = { version = "5.0.1", optional = true, default-features = false } memchr = "2.2.1" tokio-02 = { package = "tokio", version = "0.2.21", optional = true, default-features = false } tokio-03 = { package = "tokio", version = "0.3.0", optional = true, default-features = false } tokio = { version = "1.0.0", optional = true, default-features = false } [dev-dependencies] -proptest = "0.9.4" -proptest-derive = "0.1.2" -rand = "0.7.2" +proptest = "1.0.0" +proptest-derive = "0.3.0" +rand = "0.8.5" futures = "0.3.5" futures-test = "0.3.5" -ntest = "0.7.3" +ntest = "0.8.1" bytes-05 = { package = "bytes", version = "0.5.0" } bytes-06 = { package = "bytes", version = "0.6.0" } bytes = "1.0.0" @@ -68,7 +68,6 @@ tokio-util-03 = { package = "tokio-util", version = "0.3.0", default-features = tokio-util-04 = { package = "tokio-util", version = "0.4.0", default-features = false, features = ["io"] } tokio-util-05 = { package = "tokio-util", version = "0.5.0", default-features = false, features = ["io"] } tokio-util-06 = { package = "tokio-util", version = "0.6.0", default-features = false, features = ["io"] } -futures_codec = { version = "0.4.1", default-features = false } [[test]] name = "brotli" diff --git a/bors.toml b/bors.toml index 98990d39..b0a311e6 100644 --- a/bors.toml +++ b/bors.toml @@ -10,7 +10,7 @@ status = [ "cargo hack check --all-targets --feature-powerset", "cargo fmt --check", "cargo clippy", - "cargo audit", + "cargo deny bans licenses sources", "cargo doc --cfg docsrs", ] delete_merged_branches = true diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..c6832572 --- /dev/null +++ b/deny.toml @@ -0,0 +1,32 @@ +[advisories] +ignore = [ + # tokio 0.2 and 0.3 are both perma-vulnerable to these two advisories, + # will be removed once support for them is dropped + "RUSTSEC-2021-0072", + "RUSTSEC-2021-0124", +] + +[licenses] +unlicensed = "deny" +allow = [ + "MIT", + "Apache-2.0", + "BSD-3-Clause", +] +default = "deny" + +[bans] +multiple-versions = "warn" +skip = [ + # Used in the stream migration docs + { name = "tokio-util", version = "0.3" }, + { name = "tokio-util", version = "0.4" }, + { name = "tokio-util", version = "0.5" }, + { name = "tokio-util", version = "0.6" }, +] +skip-tree = [ + { name = "tokio", version = "0.2" }, + { name = "tokio", version = "0.3" }, + { name = "proptest", version = "1.0" }, + { name = "proptest-derive", version = "0.3" }, +] diff --git a/src/codec/brotli/decoder.rs b/src/codec/brotli/decoder.rs index 392b4565..648f173d 100644 --- a/src/codec/brotli/decoder.rs +++ b/src/codec/brotli/decoder.rs @@ -7,17 +7,18 @@ use std::{ use brotli::{enc::StandardAlloc, BrotliDecompressStream, BrotliResult, BrotliState}; pub struct BrotliDecoder { - state: BrotliState, + // `BrotliState` is very large (over 2kb) which is why we're boxing it. + state: Box>, } impl BrotliDecoder { pub(crate) fn new() -> Self { Self { - state: BrotliState::new( + state: Box::new(BrotliState::new( StandardAlloc::default(), StandardAlloc::default(), StandardAlloc::default(), - ), + )), } } @@ -35,10 +36,10 @@ impl BrotliDecoder { let status = match BrotliDecompressStream( &mut in_buf.len(), &mut input_len, - &in_buf, + in_buf, &mut out_buf.len(), &mut output_len, - &mut out_buf, + out_buf, &mut 0, &mut self.state, ) { @@ -57,11 +58,11 @@ impl BrotliDecoder { impl Decode for BrotliDecoder { fn reinit(&mut self) -> Result<()> { - self.state = BrotliState::new( + self.state = Box::new(BrotliState::new( StandardAlloc::default(), StandardAlloc::default(), StandardAlloc::default(), - ); + )); Ok(()) } diff --git a/src/codec/brotli/encoder.rs b/src/codec/brotli/encoder.rs index 776246b6..c621464f 100644 --- a/src/codec/brotli/encoder.rs +++ b/src/codec/brotli/encoder.rs @@ -43,7 +43,7 @@ impl BrotliEncoder { in_buf, &mut input_len, &mut out_buf.len(), - &mut out_buf, + out_buf, &mut output_len, &mut None, &mut |_, _, _, _| (), diff --git a/src/codec/gzip/header.rs b/src/codec/gzip/header.rs index 2132da08..8d82301e 100644 --- a/src/codec/gzip/header.rs +++ b/src/codec/gzip/header.rs @@ -85,7 +85,7 @@ impl Parser { data.copy_unwritten_from(input); if data.unwritten().is_empty() { - let len = u16::from_be_bytes(data.take().into_inner()); + let len = u16::from_le_bytes(data.take().into_inner()); self.state = State::Extra(vec![0; usize::from(len)].into()); } else { return Ok(None); diff --git a/src/futures/bufread/generic/decoder.rs b/src/futures/bufread/generic/decoder.rs index ff39b163..d19daae5 100644 --- a/src/futures/bufread/generic/decoder.rs +++ b/src/futures/bufread/generic/decoder.rs @@ -70,6 +70,9 @@ impl Decoder { State::Decoding => { let input = ready!(this.reader.as_mut().poll_fill_buf(cx))?; if input.is_empty() { + // Avoid attempting to reinitialise the decoder if the reader + // has returned EOF. + *this.multiple_members = false; State::Flushing } else { let mut input = PartialBuffer::new(input); diff --git a/src/lib.rs b/src/lib.rs index 31d921d9..108cb859 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -244,7 +244,7 @@ impl Level { Self::Fastest => 1, Self::Best => 21, Self::Precise(quality) => quality.min(21) as i32, - Self::Default => 0, + Self::Default => libzstd::DEFAULT_COMPRESSION_LEVEL, } } diff --git a/src/tokio/bufread/generic/decoder.rs b/src/tokio/bufread/generic/decoder.rs index e9ef44e8..2f4d8c7f 100644 --- a/src/tokio/bufread/generic/decoder.rs +++ b/src/tokio/bufread/generic/decoder.rs @@ -70,6 +70,9 @@ impl Decoder { State::Decoding => { let input = ready!(this.reader.as_mut().poll_fill_buf(cx))?; if input.is_empty() { + // Avoid attempting to reinitialise the decoder if the reader + // has returned EOF. + *this.multiple_members = false; State::Flushing } else { let mut input = PartialBuffer::new(input); diff --git a/src/tokio_02/bufread/generic/decoder.rs b/src/tokio_02/bufread/generic/decoder.rs index 7e876770..38dc068d 100644 --- a/src/tokio_02/bufread/generic/decoder.rs +++ b/src/tokio_02/bufread/generic/decoder.rs @@ -70,6 +70,9 @@ impl Decoder { State::Decoding => { let input = ready!(this.reader.as_mut().poll_fill_buf(cx))?; if input.is_empty() { + // Avoid attempting to reinitialise the decoder if the reader + // has returned EOF. + *this.multiple_members = false; State::Flushing } else { let mut input = PartialBuffer::new(input); diff --git a/src/tokio_03/bufread/generic/decoder.rs b/src/tokio_03/bufread/generic/decoder.rs index b643c636..796218c9 100644 --- a/src/tokio_03/bufread/generic/decoder.rs +++ b/src/tokio_03/bufread/generic/decoder.rs @@ -70,6 +70,9 @@ impl Decoder { State::Decoding => { let input = ready!(this.reader.as_mut().poll_fill_buf(cx))?; if input.is_empty() { + // Avoid attempting to reinitialise the decoder if the reader + // has returned EOF. + *this.multiple_members = false; State::Flushing } else { let mut input = PartialBuffer::new(input); diff --git a/tests/gzip.rs b/tests/gzip.rs index 1594986f..b17c7b34 100644 --- a/tests/gzip.rs +++ b/tests/gzip.rs @@ -109,6 +109,7 @@ fn compress_with_header(data: &[u8]) -> Vec { let mut gz = GzBuilder::new() .filename("hello_world.txt") .comment("test file, please delete") + .extra(vec![1, 2, 3, 4]) .write(&mut bytes, Compression::fast()); gz.write_all(data).unwrap(); diff --git a/tests/utils/impls.rs b/tests/utils/impls.rs index a1b1ac8c..18cea2eb 100644 --- a/tests/utils/impls.rs +++ b/tests/utils/impls.rs @@ -13,13 +13,13 @@ pub mod futures { pub mod bufread { pub use futures::io::AsyncBufRead; - use crate::utils::InputStream; + use crate::utils::{InputStream, TrackEof}; use futures::stream::{StreamExt as _, TryStreamExt as _}; pub fn from(input: &InputStream) -> impl AsyncBufRead { // By using the stream here we ensure that each chunk will require a separate // read/poll_fill_buf call to process to help test reading multiple chunks. - input.stream().map(Ok).into_async_read() + TrackEof::new(input.stream().map(Ok).into_async_read()) } } @@ -100,13 +100,13 @@ pub mod tokio_02 { pub mod bufread { pub use tokio_02::io::AsyncBufRead; - use crate::utils::InputStream; + use crate::utils::{InputStream, TrackEof}; use tokio_02::io::stream_reader; pub fn from(input: &InputStream) -> impl AsyncBufRead { // By using the stream here we ensure that each chunk will require a separate // read/poll_fill_buf call to process to help test reading multiple chunks. - stream_reader(input.bytes_05_stream()) + TrackEof::new(stream_reader(input.bytes_05_stream())) } } @@ -169,14 +169,14 @@ pub mod tokio_02 { #[cfg(feature = "tokio-03")] pub mod tokio_03 { pub mod bufread { - use crate::utils::InputStream; + use crate::utils::{InputStream, TrackEof}; pub use tokio_03::io::AsyncBufRead; use tokio_util_04::io::StreamReader; pub fn from(input: &InputStream) -> impl AsyncBufRead { // By using the stream here we ensure that each chunk will require a separate // read/poll_fill_buf call to process to help test reading multiple chunks. - StreamReader::new(input.bytes_05_stream()) + TrackEof::new(StreamReader::new(input.bytes_05_stream())) } } @@ -239,7 +239,7 @@ pub mod tokio_03 { #[cfg(feature = "tokio")] pub mod tokio { pub mod bufread { - use crate::utils::InputStream; + use crate::utils::{InputStream, TrackEof}; use bytes::Bytes; use futures::stream::StreamExt; pub use tokio::io::AsyncBufRead; @@ -248,7 +248,9 @@ pub mod tokio { pub fn from(input: &InputStream) -> impl AsyncBufRead { // By using the stream here we ensure that each chunk will require a separate // read/poll_fill_buf call to process to help test reading multiple chunks. - StreamReader::new(input.stream().map(Bytes::from).map(std::io::Result::Ok)) + TrackEof::new(StreamReader::new( + input.stream().map(Bytes::from).map(std::io::Result::Ok), + )) } } diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index a83a1506..0f6de461 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -8,13 +8,14 @@ mod tokio_03_ext; #[cfg(feature = "tokio")] mod tokio_ext; mod track_closed; +mod track_eof; #[macro_use] mod test_cases; pub mod algos; pub mod impls; -pub use self::{input_stream::InputStream, track_closed::TrackClosed}; +pub use self::{input_stream::InputStream, track_closed::TrackClosed, track_eof::TrackEof}; pub use async_compression::Level; pub use futures::{executor::block_on, pin_mut, stream::Stream}; pub use std::{future::Future, io::Result, iter::FromIterator, pin::Pin}; diff --git a/tests/utils/track_eof.rs b/tests/utils/track_eof.rs new file mode 100644 index 00000000..d2101d13 --- /dev/null +++ b/tests/utils/track_eof.rs @@ -0,0 +1,184 @@ +#[cfg_attr(not(feature = "all-implementations"), allow(unused))] +use std::{ + io::Result, + pin::Pin, + task::{Context, Poll}, +}; + +pub struct TrackEof { + inner: R, + eof: bool, +} + +impl TrackEof { + pub fn new(inner: R) -> Self { + Self { inner, eof: false } + } + + pub fn project(self: Pin<&mut Self>) -> (Pin<&mut R>, &mut bool) { + let Self { inner, eof } = Pin::into_inner(self); + (Pin::new(inner), eof) + } +} + +#[cfg(feature = "futures-io")] +impl futures::io::AsyncRead for TrackEof { + fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_read(cx, buf) { + Poll::Ready(Ok(0)) => { + if !buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(0)) + } + other => other, + } + } +} + +#[cfg(feature = "futures-io")] +impl futures::io::AsyncBufRead for TrackEof { + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_fill_buf(cx) { + Poll::Ready(Ok(buf)) => { + if buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(buf)) + } + other => other, + } + } + + fn consume(self: Pin<&mut Self>, amt: usize) { + self.project().0.consume(amt) + } +} + +#[cfg(feature = "tokio-02")] +impl tokio_02::io::AsyncRead for TrackEof { + fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_read(cx, buf) { + Poll::Ready(Ok(0)) => { + if !buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(0)) + } + other => other, + } + } +} + +#[cfg(feature = "tokio-02")] +impl tokio_02::io::AsyncBufRead for TrackEof { + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_fill_buf(cx) { + Poll::Ready(Ok(buf)) => { + if buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(buf)) + } + other => other, + } + } + + fn consume(self: Pin<&mut Self>, amt: usize) { + self.project().0.consume(amt) + } +} + +#[cfg(feature = "tokio-03")] +impl tokio_03::io::AsyncRead for TrackEof { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut tokio_03::io::ReadBuf, + ) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + let len = buf.filled().len(); + match inner.poll_read(cx, buf) { + Poll::Ready(Ok(())) => { + if buf.filled().len() == len && buf.remaining() > 0 { + *eof = true; + } + Poll::Ready(Ok(())) + } + other => other, + } + } +} + +#[cfg(feature = "tokio-03")] +impl tokio_03::io::AsyncBufRead for TrackEof { + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_fill_buf(cx) { + Poll::Ready(Ok(buf)) => { + if buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(buf)) + } + other => other, + } + } + + fn consume(self: Pin<&mut Self>, amt: usize) { + self.project().0.consume(amt) + } +} + +#[cfg(feature = "tokio")] +impl tokio::io::AsyncRead for TrackEof { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut tokio::io::ReadBuf, + ) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + let len = buf.filled().len(); + match inner.poll_read(cx, buf) { + Poll::Ready(Ok(())) => { + if buf.filled().len() == len && buf.remaining() > 0 { + *eof = true; + } + Poll::Ready(Ok(())) + } + other => other, + } + } +} + +#[cfg(feature = "tokio")] +impl tokio::io::AsyncBufRead for TrackEof { + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + let (inner, eof) = self.project(); + assert!(!*eof); + match inner.poll_fill_buf(cx) { + Poll::Ready(Ok(buf)) => { + if buf.is_empty() { + *eof = true; + } + Poll::Ready(Ok(buf)) + } + other => other, + } + } + + fn consume(self: Pin<&mut Self>, amt: usize) { + self.project().0.consume(amt) + } +}