From a16ea65031cca3c19e1b08706dd77528f7c59eff Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Wed, 17 Nov 2021 21:00:32 +0100 Subject: [PATCH] Add `axum-extra` crate (#536) * Add `axum-extra` crate Empty for now but now we have a place to put stuff. I'll make a PR for moving over https://github.com/davidpdrsn/axum-resource. * remove `authors` field from `Cargo.toml`s --- .github/workflows/CI.yml | 1 + Cargo.toml | 1 + axum-debug/Cargo.toml | 1 - axum-extra/CHANGELOG.md | 10 +++++++++ axum-extra/Cargo.toml | 14 +++++++++++++ axum-extra/LICENSE | 7 +++++++ axum-extra/README.md | 45 ++++++++++++++++++++++++++++++++++++++++ axum-extra/src/lib.rs | 43 ++++++++++++++++++++++++++++++++++++++ axum/Cargo.toml | 1 - 9 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 axum-extra/CHANGELOG.md create mode 100644 axum-extra/Cargo.toml create mode 100644 axum-extra/LICENSE create mode 100644 axum-extra/README.md create mode 100644 axum-extra/src/lib.rs diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6ce8ceee..3654a094 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -100,6 +100,7 @@ jobs: command: test args: > -p axum + -p axum-extra --all-features --all-targets # the compiler errors are different on 1.54 which makes # the trybuild tests in axum-debug fail, so just run the doc diff --git a/Cargo.toml b/Cargo.toml index 1080e44e..c9d18a92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,5 +2,6 @@ members = [ "axum", "axum-debug", + "axum-extra", "examples/*", ] diff --git a/axum-debug/Cargo.toml b/axum-debug/Cargo.toml index 7c492399..0d30bf20 100644 --- a/axum-debug/Cargo.toml +++ b/axum-debug/Cargo.toml @@ -1,5 +1,4 @@ [package] -authors = ["Programatik "] categories = ["development-tools::debugging"] description = "Better error messages for axum framework." edition = "2018" diff --git a/axum-extra/CHANGELOG.md b/axum-extra/CHANGELOG.md new file mode 100644 index 00000000..16a28cbb --- /dev/null +++ b/axum-extra/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +# Unreleased + +- None. diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml new file mode 100644 index 00000000..7efd9e02 --- /dev/null +++ b/axum-extra/Cargo.toml @@ -0,0 +1,14 @@ +[package] +categories = ["asynchronous", "network-programming", "web-programming"] +description = "Extra utilities for axum" +edition = "2018" +homepage = "https://github.com/tokio-rs/axum" +keywords = ["http", "web", "framework"] +license = "MIT" +name = "axum-extra" +readme = "README.md" +repository = "https://github.com/tokio-rs/axum" +version = "0.1.0" + +[dependencies] +axum = { path = "../axum", version = "0.3" } diff --git a/axum-extra/LICENSE b/axum-extra/LICENSE new file mode 100644 index 00000000..538d04ab --- /dev/null +++ b/axum-extra/LICENSE @@ -0,0 +1,7 @@ +Copyright 2021 Axum 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/axum-extra/README.md b/axum-extra/README.md new file mode 100644 index 00000000..3efacb9c --- /dev/null +++ b/axum-extra/README.md @@ -0,0 +1,45 @@ +# axum-extra + +[![Build status](https://github.com/tokio-rs/axum/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tokio-rs/axum-extra/actions/workflows/CI.yml) +[![Crates.io](https://img.shields.io/crates/v/axum-extra)](https://crates.io/crates/axum-extra) +[![Documentation](https://docs.rs/axum-extra/badge.svg)](https://docs.rs/axum-extra) + +Extra utilities for [`axum`]. + +More information about this crate can be found in the [crate documentation][docs]. + +## Safety + +This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust. + +## Minimum supported Rust version + +axum-extra's MSRV is 1.54. + +## Getting Help + +You're also welcome to ask in the [Discord channel][chat] or open an [issue] +with your question. + +## Contributing + +:balloon: Thanks for your help improving the project! We are so happy to have +you! We have a [contributing guide][contributing] to help you get involved in the +`axum` project. + +## License + +This project is licensed under the [MIT license][license]. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in `axum` by you, shall be licensed as MIT, without any +additional terms or conditions. + +[`axum`]: https://crates.io/crates/axum +[chat]: https://discord.gg/tokio +[contributing]: /CONTRIBUTING.md +[docs]: https://docs.rs/axum-extra +[license]: /axum-extra/LICENSE +[issue]: https://github.com/tokio-rs/axum/issues/new diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs new file mode 100644 index 00000000..4d623774 --- /dev/null +++ b/axum-extra/src/lib.rs @@ -0,0 +1,43 @@ +//! Extra utilities for [`axum`]. +//! +//! [`axum`]: https://crates.io/crates/axum + +#![warn( + clippy::all, + clippy::dbg_macro, + clippy::todo, + clippy::empty_enum, + clippy::enum_glob_use, + clippy::mem_forget, + clippy::unused_self, + clippy::filter_map_next, + clippy::needless_continue, + clippy::needless_borrow, + clippy::match_wildcard_for_single_variants, + clippy::if_let_mutex, + clippy::mismatched_target_os, + clippy::await_holding_lock, + clippy::match_on_vec_items, + clippy::imprecise_flops, + clippy::suboptimal_flops, + clippy::lossy_float_literal, + clippy::rest_pat_in_fully_bound_structs, + clippy::fn_params_excessive_bools, + clippy::exit, + clippy::inefficient_to_string, + clippy::linkedlist, + clippy::macro_use_imports, + clippy::option_option, + clippy::verbose_file_reads, + clippy::unnested_or_patterns, + rust_2018_idioms, + future_incompatible, + nonstandard_style, + missing_debug_implementations, + missing_docs +)] +#![deny(unreachable_pub, private_in_public)] +#![allow(elided_lifetimes_in_paths, clippy::type_complexity)] +#![forbid(unsafe_code)] +#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(test, allow(clippy::float_cmp))] diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 890c0ed8..aac4ee36 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "axum" version = "0.3.3" -authors = ["David Pedersen "] categories = ["asynchronous", "network-programming", "web-programming"] description = "Web framework that focuses on ergonomics and modularity" edition = "2018"