mirror of
https://github.com/tokio-rs/axum.git
synced 2025-03-26 08:32:48 +01:00
Update to syn 2 (#1862)
This commit is contained in:
parent
b315e5b37e
commit
8e1eb8979f
19 changed files with 28 additions and 25 deletions
axum-core
axum-extra
axum-macros
axum
deny.tomlexamples
|
@ -15,7 +15,7 @@ version = "0.3.3" # remember to also bump the version that axum depends on
|
|||
__private_docs = ["dep:tower-http"]
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
async-trait = "0.1.67"
|
||||
bytes = "1.0"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
http = "0.2.7"
|
||||
|
@ -32,7 +32,7 @@ rustversion = "1.0.9"
|
|||
|
||||
[dev-dependencies]
|
||||
axum = { path = "../axum", version = "0.6.0", features = ["headers"] }
|
||||
futures-util = "0.3"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
hyper = "0.14.24"
|
||||
tokio = { version = "1.25.0", features = ["macros"] }
|
||||
tower-http = { version = "0.4", features = ["limit"] }
|
||||
|
|
|
@ -62,7 +62,6 @@ tokio-util = { version = "0.7", optional = true }
|
|||
|
||||
[dev-dependencies]
|
||||
axum = { path = "../axum", version = "0.6.0", features = ["headers"] }
|
||||
futures = "0.3"
|
||||
http-body = "0.4.4"
|
||||
hyper = "0.14"
|
||||
reqwest = { version = "0.11", default-features = false, features = ["json", "stream", "multipart"] }
|
||||
|
|
|
@ -32,7 +32,7 @@ pin_project! {
|
|||
///
|
||||
/// ```rust
|
||||
/// use axum_extra::json_lines::JsonLines;
|
||||
/// use futures::stream::StreamExt;
|
||||
/// use futures_util::stream::StreamExt;
|
||||
///
|
||||
/// async fn handler(mut stream: JsonLines<serde_json::Value>) {
|
||||
/// while let Some(value) = stream.next().await {
|
||||
|
@ -46,10 +46,10 @@ pin_project! {
|
|||
/// ```rust
|
||||
/// use axum::{BoxError, response::{IntoResponse, Response}};
|
||||
/// use axum_extra::json_lines::JsonLines;
|
||||
/// use futures::stream::Stream;
|
||||
/// use futures_util::stream::Stream;
|
||||
///
|
||||
/// fn stream_of_values() -> impl Stream<Item = Result<serde_json::Value, BoxError>> {
|
||||
/// # futures::stream::empty()
|
||||
/// # futures_util::stream::empty()
|
||||
/// }
|
||||
///
|
||||
/// async fn handler() -> Response {
|
||||
|
|
|
@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
# Unreleased
|
||||
|
||||
- None.
|
||||
- **change:** Update to syn 2.0 ([#1862])
|
||||
|
||||
[#1862]: https://github.com/tokio-rs/axum/pull/1862
|
||||
|
||||
# 0.3.6 (13. March, 2023)
|
||||
|
||||
|
|
|
@ -22,8 +22,9 @@ proc-macro = true
|
|||
heck = "0.4"
|
||||
proc-macro2 = "1.0"
|
||||
quote = "1.0"
|
||||
syn = { version = "1.0", features = [
|
||||
syn = { version = "2.0", features = [
|
||||
"full",
|
||||
"parsing",
|
||||
# needed for `Hash` impls
|
||||
"extra-traits",
|
||||
] }
|
||||
|
@ -34,7 +35,7 @@ axum-extra = { path = "../axum-extra", version = "0.7.0", features = ["typed-rou
|
|||
rustversion = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
syn = { version = "1.0", features = ["full", "extra-traits"] }
|
||||
syn = { version = "2.0", features = ["full", "extra-traits"] }
|
||||
tokio = { version = "1.25.0", features = ["full"] }
|
||||
trybuild = "1.0.63"
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ where
|
|||
{
|
||||
attrs
|
||||
.iter()
|
||||
.filter(|attr| attr.path.is_ident(ident))
|
||||
.filter(|attr| attr.meta.path().is_ident(ident))
|
||||
.map(|attr| attr.parse_args::<T>())
|
||||
.try_fold(T::default(), |out, next| out.combine(next?))
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ ws = ["tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64"]
|
|||
__private_docs = ["tower/full", "dep:tower-http"]
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.43"
|
||||
async-trait = "0.1.67"
|
||||
axum-core = { path = "../axum-core", version = "0.3.3" }
|
||||
bitflags = "1.0"
|
||||
bytes = "1.0"
|
||||
|
@ -103,7 +103,6 @@ rustversion = "1.0.9"
|
|||
[dev-dependencies]
|
||||
anyhow = "1.0"
|
||||
axum-macros = { path = "../axum-macros", version = "0.3.4", features = ["__private"] }
|
||||
futures = "0.3"
|
||||
quickcheck = "1.0"
|
||||
quickcheck_macros = "1.0"
|
||||
reqwest = { version = "0.11.14", default-features = false, features = ["json", "stream", "multipart"] }
|
||||
|
|
|
@ -32,7 +32,7 @@ pin_project! {
|
|||
/// body::StreamBody,
|
||||
/// response::IntoResponse,
|
||||
/// };
|
||||
/// use futures::stream::{self, Stream};
|
||||
/// use futures_util::stream::{self, Stream};
|
||||
/// use std::io;
|
||||
///
|
||||
/// async fn handler() -> StreamBody<impl Stream<Item = io::Result<&'static str>>> {
|
||||
|
|
|
@ -225,7 +225,7 @@ use axum::{
|
|||
body::Body,
|
||||
http::Request,
|
||||
};
|
||||
use futures::future::BoxFuture;
|
||||
use futures_util::future::BoxFuture;
|
||||
use tower::{Service, Layer};
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ use std::{
|
|||
/// routing::post,
|
||||
/// Router,
|
||||
/// };
|
||||
/// use futures::stream::StreamExt;
|
||||
/// use futures_util::stream::StreamExt;
|
||||
///
|
||||
/// async fn upload(mut multipart: Multipart) {
|
||||
/// while let Some(mut field) = multipart.next_field().await.unwrap() {
|
||||
|
|
|
@ -13,7 +13,7 @@ use std::convert::Infallible;
|
|||
/// routing::get,
|
||||
/// Router,
|
||||
/// };
|
||||
/// use futures::StreamExt;
|
||||
/// use futures_util::StreamExt;
|
||||
///
|
||||
/// async fn handler(RawQuery(query): RawQuery) {
|
||||
/// // ...
|
||||
|
|
|
@ -117,7 +117,7 @@ where
|
|||
/// routing::get,
|
||||
/// Router,
|
||||
/// };
|
||||
/// use futures::StreamExt;
|
||||
/// use futures_util::StreamExt;
|
||||
///
|
||||
/// async fn handler(mut stream: BodyStream) {
|
||||
/// while let Some(chunk) = stream.next().await {
|
||||
|
@ -192,7 +192,7 @@ fn body_stream_traits() {
|
|||
/// routing::get,
|
||||
/// Router,
|
||||
/// };
|
||||
/// use futures::StreamExt;
|
||||
/// use futures_util::StreamExt;
|
||||
///
|
||||
/// async fn handler(RawBody(body): RawBody) {
|
||||
/// // ...
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
//!
|
||||
//! ```rust,no_run
|
||||
//! use axum::{Error, extract::ws::{WebSocket, Message}};
|
||||
//! use futures::{sink::SinkExt, stream::{StreamExt, SplitSink, SplitStream}};
|
||||
//! use futures_util::{sink::SinkExt, stream::{StreamExt, SplitSink, SplitStream}};
|
||||
//!
|
||||
//! async fn handle_socket(mut socket: WebSocket) {
|
||||
//! let (mut sender, mut receiver) = socket.split();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//! };
|
||||
//! use std::{time::Duration, convert::Infallible};
|
||||
//! use tokio_stream::StreamExt as _ ;
|
||||
//! use futures::stream::{self, Stream};
|
||||
//! use futures_util::stream::{self, Stream};
|
||||
//!
|
||||
//! let app = Router::new().route("/sse", get(sse_handler));
|
||||
//!
|
||||
|
@ -509,7 +509,7 @@ impl<'a> Iterator for MemchrSplit<'a> {
|
|||
mod tests {
|
||||
use super::*;
|
||||
use crate::{routing::get, test_helpers::*, Router};
|
||||
use futures::stream;
|
||||
use futures_util::stream;
|
||||
use std::{collections::HashMap, convert::Infallible};
|
||||
use tokio_stream::StreamExt as _;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ async fn layer() {
|
|||
async fn layer_and_handle_error() {
|
||||
let one = Router::new().route("/foo", get(|| async {}));
|
||||
let two = Router::new()
|
||||
.route("/timeout", get(futures::future::pending::<()>))
|
||||
.route("/timeout", get(std::future::pending::<()>))
|
||||
.layer(
|
||||
ServiceBuilder::new()
|
||||
.layer(HandleErrorLayer::new(|_| async {
|
||||
|
|
|
@ -23,6 +23,8 @@ skip-tree = [
|
|||
{ name = "windows-sys" },
|
||||
# old version pulled in by rustls via ring
|
||||
{ name = "spin" },
|
||||
# lots still pulls in syn 1.x
|
||||
{ name = "syn" },
|
||||
]
|
||||
|
||||
[sources]
|
||||
|
|
|
@ -6,7 +6,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
axum = { path = "../../axum" }
|
||||
futures-util = "0.3"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
hyper = { version = "0.14", features = ["full"] }
|
||||
openssl = "0.10"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
|
|
@ -6,7 +6,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
axum = { path = "../../axum" }
|
||||
futures-util = "0.3"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
hyper = { version = "0.14", features = ["full"] }
|
||||
rustls-pemfile = "0.3"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
|
|
@ -5,7 +5,7 @@ publish = false
|
|||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
async-trait = "0.1.67"
|
||||
axum = { path = "../../axum" }
|
||||
http-body = "0.4.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
|
Loading…
Add table
Reference in a new issue