From 96b0dfeac3e605f4e0eda6bf94e63e8e69e70ca7 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 23 Jan 2020 06:23:53 +0900 Subject: [PATCH 1/9] Tweak actions (#1305) * Add benchmark action * Fix Windows build --- .github/workflows/bench.yml | 42 +++++++++++++++++++++++++++++++++++ .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 22 +++++++++++++----- 3 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 000000000..3c9deb49c --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,42 @@ +name: Benchmark (Linux) + +on: [push, pull_request] + +jobs: + check_benchmark: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-${{ hashFiles('**/Cargo.lock') }} + + - name: Check benchmark + uses: actions-rs/cargo@v1 + with: + command: bench diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f50ae2f05..d30d6b3e9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -27,7 +27,7 @@ jobs: - name: Generate Cargo.lock uses: actions-rs/cargo@v1 with: - command: update + command: generate-lockfile - name: Cache cargo registry uses: actions/cache@v1 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9aa3d3ba4..52c82a886 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,6 +3,7 @@ name: CI (Windows) on: [push, pull_request] env: + VCPKG_HASH: 3f62e5d55d1a7d8905df35d5c441d6e9ad64ffdf VCPKGRS_DYNAMIC: 1 jobs: @@ -30,7 +31,7 @@ jobs: - name: Generate Cargo.lock uses: actions-rs/cargo@v1 with: - command: update + command: generate-lockfile - name: Cache cargo registry uses: actions/cache@v1 with: @@ -50,14 +51,23 @@ jobs: uses: actions/cache@v1 id: cache-vcpkg with: - path: C:\vcpkg - key: windows_x64-${{ matrix.version }}-vcpkg + path: vcpkg + key: windows_x64-${{ env.VCPKG_HASH }}-vcpkg - name: Install OpenSSL if: steps.cache-vcpkg.outputs.cache-hit != 'true' + shell: pwsh run: | - vcpkg integrate install - vcpkg install openssl:x64-windows + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + git reset --hard $VCPKG_HASH + .\bootstrap-vcpkg.bat + .\vcpkg integrate install + .\vcpkg install openssl:x64-windows + Copy-Item .\installed\x64-windows\bin\libcrypto-1_1-x64.dll .\installed\x64-windows\bin\libcrypto.dll + Copy-Item .\installed\x64-windows\bin\libssl-1_1-x64.dll .\installed\x64-windows\bin\libssl.dll + Get-ChildItem .\installed\x64-windows\bin + Get-ChildItem .\installed\x64-windows\lib - name: check build uses: actions-rs/cargo@v1 @@ -76,4 +86,4 @@ jobs: --skip=test_simple --skip=test_expect_continue --skip=test_http10_keepalive - --skip=test_slow_request + --skip=test_slow_request From f02ad2913f8f416c597ec75e5f0541f0d40a2cbf Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 23 Jan 2020 11:27:34 +0900 Subject: [PATCH 2/9] Fix vcpkg cache (#1312) --- .github/workflows/windows.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 52c82a886..06f5af824 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,7 +3,6 @@ name: CI (Windows) on: [push, pull_request] env: - VCPKG_HASH: 3f62e5d55d1a7d8905df35d5c441d6e9ad64ffdf VCPKGRS_DYNAMIC: 1 jobs: @@ -47,27 +46,15 @@ jobs: with: path: target key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-build-${{ hashFiles('**/Cargo.lock') }} - - name: Cache vcpkg package - uses: actions/cache@v1 - id: cache-vcpkg - with: - path: vcpkg - key: windows_x64-${{ env.VCPKG_HASH }}-vcpkg - name: Install OpenSSL - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - shell: pwsh run: | - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - git reset --hard $VCPKG_HASH - .\bootstrap-vcpkg.bat - .\vcpkg integrate install - .\vcpkg install openssl:x64-windows - Copy-Item .\installed\x64-windows\bin\libcrypto-1_1-x64.dll .\installed\x64-windows\bin\libcrypto.dll - Copy-Item .\installed\x64-windows\bin\libssl-1_1-x64.dll .\installed\x64-windows\bin\libssl.dll - Get-ChildItem .\installed\x64-windows\bin - Get-ChildItem .\installed\x64-windows\lib + vcpkg integrate install + vcpkg install openssl:x64-windows + Copy-Item C:\vcpkg\installed\x64-windows\bin\libcrypto-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libcrypto.dll + Copy-Item C:\vcpkg\installed\x64-windows\bin\libssl-1_1-x64.dll C:\vcpkg\installed\x64-windows\bin\libssl.dll + Get-ChildItem C:\vcpkg\installed\x64-windows\bin + Get-ChildItem C:\vcpkg\installed\x64-windows\lib - name: check build uses: actions-rs/cargo@v1 From 54ff97470ebc377718794b92259c03621e2b07b6 Mon Sep 17 00:00:00 2001 From: cetra3 Date: Thu, 23 Jan 2020 22:32:34 +0000 Subject: [PATCH 3/9] Initial Issue template (#1311) * Initial Issue template * First round of changes for the bug report Co-authored-by: Yuki Okushi --- .github/ISSUE_TEMPLATE/bug_report.md | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..0c4e6c1c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +Your issue may already be reported! +Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one. + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + +## Steps to Reproduce (for bugs) + + +1. +2. +3. +4. + +## Context + + + +## Your Environment + + +* Rust Version (I.e, output of `rustc -V`): +* Actix Web Version: \ No newline at end of file From 4aa4b5f928c1e18188bbe559f065a66924485991 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 25 Jan 2020 02:27:13 +0900 Subject: [PATCH 4/9] Tweak caches (#1319) * Try to use `cargo-cache` * Tweak issue template --- .github/ISSUE_TEMPLATE/bug_report.md | 7 ++++++- .github/workflows/bench.yml | 11 ++++++++--- .github/workflows/macos.yml | 11 ++++++++--- .github/workflows/windows.yml | 11 ++++++++--- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0c4e6c1c6..128f51ffd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,3 +1,8 @@ +--- +name: bug report +about: create a bug report +--- + Your issue may already be reported! Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one. @@ -29,4 +34,4 @@ Please search on the [Actix Web issue tracker](https://github.com/actix/actix-we * Rust Version (I.e, output of `rustc -V`): -* Actix Web Version: \ No newline at end of file +* Actix Web Version: diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 3c9deb49c..08bb81d48 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -24,19 +24,24 @@ jobs: uses: actions/cache@v1 with: path: ~/.cargo/registry - key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-registry-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index uses: actions/cache@v1 with: path: ~/.cargo/git - key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build uses: actions/cache@v1 with: path: target - key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Check benchmark uses: actions-rs/cargo@v1 with: command: bench + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d30d6b3e9..397236a29 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -32,17 +32,17 @@ jobs: uses: actions/cache@v1 with: path: ~/.cargo/registry - key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index uses: actions/cache@v1 with: path: ~/.cargo/git - key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-index-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build uses: actions/cache@v1 with: path: target - key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-build-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: check build uses: actions-rs/cargo@v1 @@ -57,3 +57,8 @@ jobs: args: --all --all-features --no-fail-fast -- --nocapture --skip=test_h2_content_length --skip=test_reading_deflate_encoding_large_random_rustls + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 06f5af824..fed4ce031 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,17 +35,17 @@ jobs: uses: actions/cache@v1 with: path: ~/.cargo/registry - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index uses: actions/cache@v1 with: path: ~/.cargo/git - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-index-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo build uses: actions/cache@v1 with: path: target - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-build-${{ hashFiles('**/Cargo.lock') }} + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Install OpenSSL run: | @@ -74,3 +74,8 @@ jobs: --skip=test_expect_continue --skip=test_http10_keepalive --skip=test_slow_request + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache From 228e8869863b9a2dbcda0544549dbb9304a95f17 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 29 Jan 2020 09:00:04 +0900 Subject: [PATCH 5/9] Don't use cache in Windows CI (#1327) --- .github/workflows/windows.yml | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fed4ce031..36b224ba6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,26 +27,6 @@ jobs: profile: minimal override: true - - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v1 - with: - path: target - key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} - - name: Install OpenSSL run: | vcpkg integrate install @@ -74,8 +54,5 @@ jobs: --skip=test_expect_continue --skip=test_http10_keepalive --skip=test_slow_request - - - name: Clear the cargo caches - run: | - cargo install cargo-cache --no-default-features --features ci-autoclean - cargo-cache + --skip=test_connection_force_close + --skip=test_connection_server_close From 155a6db4cdf56f6095d48561c3f58ff0c6b13bdc Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 7 Feb 2020 23:17:03 +0900 Subject: [PATCH 6/9] More ignore test causes timeout --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 36b224ba6..5fd785fad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -56,3 +56,4 @@ jobs: --skip=test_slow_request --skip=test_connection_force_close --skip=test_connection_server_close + --skip=test_connection_wait_queue_force_close From 7b00c16d44bdb43416e09b79a0a0cfddf22df010 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 8 Feb 2020 04:28:34 +0900 Subject: [PATCH 7/9] Add some Actions workflows --- .github/workflows/linux.yml | 90 ++++++++++++++++++++++++++++++++ .github/workflows/upload-doc.yml | 35 +++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/upload-doc.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..875ce10b4 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,90 @@ +name: CI (Linux) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - 1.39.0 # MSRV + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture + + - name: tests (actix-http) + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --package=actix-http --no-default-features --features=rustls -- --nocapture + + - name: tests (awc) + uses: actions-rs/cargo@v1 + timeout-minutes: 40 + with: + command: test + args: --package=awc --no-default-features --features=rustls -- --nocapture + + - name: Generate coverage file + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml + - name: Upload to Codecov + if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: cobertura.xml + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml new file mode 100644 index 000000000..388ae3704 --- /dev/null +++ b/.github/workflows/upload-doc.yml @@ -0,0 +1,35 @@ +name: Upload documentation + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + if: github.repository == 'actix/actix-web' + + steps: + - uses: actions/checkout@master + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable-x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --all-features + + - name: Tweak HTML + run: echo "" > target/doc/index.html + + - name: Upload documentation + run: | + git clone https://github.com/davisp/ghp-import.git + ./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://${{ secrets.GITHUB_TOKEN }}@github.com/"${{ github.repository }}.git" target/doc \ No newline at end of file From ad0d809af6bb9ae94be107bdaa1e6c772671512c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 14 Feb 2020 07:31:29 +0900 Subject: [PATCH 8/9] Disable coverage for PRs --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 875ce10b4..7cabb8020 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -73,12 +73,12 @@ jobs: args: --package=awc --no-default-features --features=rustls -- --nocapture - name: Generate coverage file - if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + if: matrix.version == 'stable' && github.ref == 'refs/heads/master' run: | cargo install cargo-tarpaulin cargo tarpaulin --out Xml - name: Upload to Codecov - if: matrix.version == 'stable' && (github.ref == 'master' || github.event_name == 'pull_request') + if: matrix.version == 'stable' && github.ref == 'refs/heads/master' uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} From 87378a741031c73bb247830e525edc7f1fa1d44e Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 27 Feb 2020 22:35:57 +0900 Subject: [PATCH 9/9] Demote lint level to warn --- actix-http/src/cookie/mod.rs | 2 +- actix-http/src/lib.rs | 2 +- awc/src/lib.rs | 2 +- src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actix-http/src/cookie/mod.rs b/actix-http/src/cookie/mod.rs index 13fd5cf4e..972c61a49 100644 --- a/actix-http/src/cookie/mod.rs +++ b/actix-http/src/cookie/mod.rs @@ -47,7 +47,7 @@ //! ``` #![doc(html_root_url = "https://docs.rs/cookie/0.11")] -#![deny(missing_docs)] +#![warn(missing_docs)] mod builder; mod delta; diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index 7a47012f8..17538fde9 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -1,5 +1,5 @@ //! Basic http primitives for actix-net framework. -#![deny(rust_2018_idioms, warnings)] +#![warn(rust_2018_idioms, warnings)] #![allow( clippy::type_complexity, clippy::too_many_arguments, diff --git a/awc/src/lib.rs b/awc/src/lib.rs index 8944fe229..952a15369 100644 --- a/awc/src/lib.rs +++ b/awc/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(rust_2018_idioms, warnings)] +#![warn(rust_2018_idioms, warnings)] #![allow( clippy::type_complexity, clippy::borrow_interior_mutable_const, diff --git a/src/lib.rs b/src/lib.rs index d51005cfe..c71b285b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![deny(rust_2018_idioms, warnings)] +#![warn(rust_2018_idioms, warnings)] #![allow( clippy::needless_doctest_main, clippy::type_complexity,