programatik29 / axum-server

High level server designed to be used with axum framework.
MIT License
166 stars 54 forks source link

Update rust edition, clean up linter warnings, format code #102

Closed garlic-hub closed 6 months ago

garlic-hub commented 6 months ago

Output from cargo fix and cargo test


$ cargo fix --edition
note: Switching to Edition 2021 will enable the use of the version 2 feature resolver in Cargo.
This may cause some dependencies to be built with fewer features enabled than previously.
More information about the resolver changes may be found at https://doc.rust-lang.org/nightly/edition-guide/rust-2021/default-cargo-resolver.html
When building the following dependencies, the given features will no longer be used:

  futures-channel v0.3.28 removed features: futures-sink, sink
  futures-task v0.3.28 removed features: std
  futures-util v0.3.28 removed features: channel, futures-channel, futures-io, futures-sink, io, memchr, sink, slab, std
  hyper v1.0.1 removed features: client, full
  tokio v1.32.0 removed features: fs, full, num_cpus, parking_lot, process, rt-multi-thread, signal, signal-hook-registry, windows-sys

The following differences only apply when building with dev-dependencies:

  tokio v1.32.0 removed features: windows-sys

    Checking axum-server v0.5.1 (/home/USER/workspace/axum-server)
   Migrating src/lib.rs from 2018 edition to 2021
   Migrating examples/remote_address.rs from 2018 edition to 2021
   Migrating examples/hello_world.rs from 2018 edition to 2021
   Migrating examples/remote_address_using_tower.rs from 2018 edition to 2021
   Migrating examples/from_std_listener.rs from 2018 edition to 2021
   Migrating examples/graceful_shutdown.rs from 2018 edition to 2021
   Migrating examples/shutdown.rs from 2018 edition to 2021
   Migrating examples/multiple_addresses.rs from 2018 edition to 2021
    Finished dev [unoptimized + debuginfo] target(s) in 0.80s

$ cargo test
   Compiling tokio v1.32.0
   Compiling tokio-util v0.7.8
   Compiling tower v0.4.13
   Compiling h2 v0.4.0
   Compiling hyper v1.0.1
   Compiling hyper-util v0.1.1
   Compiling axum v0.7.2
   Compiling axum-server v0.5.1 (/home/USER/workspace/axum-server)
    Finished test [unoptimized + debuginfo] target(s) in 8.93s
     Running unittests src/lib.rs (target/debug/deps/axum_server-5c206e5f2a982fe1)

running 4 tests
test server::tests::test_shutdown ... ok
test server::tests::start_and_request ... ok
test server::tests::test_graceful_shutdown ... ok
test server::tests::test_graceful_shutdown_timed ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.25s

   Doc-tests axum-server

running 1 test
test src/lib.rs - (line 40) - compile ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s```
abs0luty commented 6 months ago

Thanks!