8 Commits
Author SHA1 Message Date
Tobias BieniekandGitHub 8def6782fb Replace custom BoxCloneService struct with tower::util::BoxCloneSyncService (#3109) 2024-12-27 08:57:52 +01:00
Tobias BieniekandGitHub f6594aaf7b clippy: Merge config files (#3108) 2024-12-26 22:02:53 +01:00
Jonas PlatteandGitHub 99c07e4d86 Enable and fix warnings from clippy::uninlined_format_args (#3063) 2024-12-03 22:27:14 +01:00
Jonas PlatteandGitHub 141198ce19 Declare MSRV in Cargo manifests, not .clippy.toml (#1206) 2022-07-28 15:31:47 +02:00
David PedersenandGitHub 93251fa203 Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
Jonas PlatteandGitHub 9470f5ae1d Update MSRV in .clippy.toml (#832) 2022-03-05 14:23:27 +01:00
David PedersenandGitHub 97c140cdf7 Add Headers response (#193)
* Add `Headers`

Example usage:

```rust
use axum::{
    route,
    routing::RoutingDsl,
    response::{IntoResponse, Headers},
    handler::get,
};
use http::header::{HeaderName, HeaderValue};

// It works with any `IntoIterator<Item = (Key, Value)>` where `Key` can be
// turned into a `HeaderName` and `Value` can be turned into a `HeaderValue`
//
// Such as `Vec<(HeaderName, HeaderValue)>`
async fn just_headers() -> impl IntoResponse {
    Headers(vec![
        (HeaderName::from_static("X-Foo"), HeaderValue::from_static("foo")),
    ])
}

// Or `[(&str, &str)]`
async fn from_strings() -> impl IntoResponse {
    Headers([("X-Foo", "foo")])
}
```

Fixes https://github.com/tokio-rs/axum/issues/187

* Make work on Rust versions without `IntoIterator` for arrays

* format

* changelog
2021-08-17 17:28:02 +02:00
Jonas PlatteandGitHub d285dfb568 Tell clippy about MSRV (#114)
* Remove unused import

* Tell clippy about MSRV
2021-08-04 12:15:58 +02:00