Switch serde dependency to serde_core (#3477)

This commit is contained in:
Jonas Platte
2025-09-28 19:28:32 +02:00
parent c40f739cdf
commit 16534439f5
19 changed files with 75 additions and 59 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ use axum::{
};
use axum_core::__composite_rejection as composite_rejection;
use axum_core::__define_rejection as define_rejection;
use serde::de::DeserializeOwned;
use serde_core::de::DeserializeOwned;
/// Extractor that deserializes `application/x-www-form-urlencoded` requests
/// into some type.
+1 -1
View File
@@ -4,7 +4,7 @@ use axum_core::__define_rejection as define_rejection;
use axum_core::extract::rejection::BytesRejection;
use bytes::Bytes;
use http::{header, HeaderMap};
use serde::Deserialize;
use serde_core::Deserialize;
use std::marker::PhantomData;
/// JSON Extractor for zero-copy deserialization.
+1 -1
View File
@@ -2,7 +2,7 @@ use axum::{
extract::{rejection::PathRejection, FromRequestParts, Path},
RequestPartsExt,
};
use serde::de::DeserializeOwned;
use serde_core::de::DeserializeOwned;
/// Extractor that extracts path arguments the same way as [`Path`], except if there aren't any.
///
+1 -1
View File
@@ -2,7 +2,7 @@ use axum::extract::FromRequestParts;
use axum_core::__composite_rejection as composite_rejection;
use axum_core::__define_rejection as define_rejection;
use http::{request::Parts, Uri};
use serde::de::DeserializeOwned;
use serde_core::de::DeserializeOwned;
/// Extractor that deserializes query strings into some type.
///
+4 -4
View File
@@ -9,7 +9,7 @@ use axum::{
use bytes::{BufMut, BytesMut};
use futures_util::stream::{BoxStream, Stream, TryStream, TryStreamExt};
use pin_project_lite::pin_project;
use serde::{de::DeserializeOwned, Serialize};
use serde_core::{de::DeserializeOwned, Serialize};
use std::{
convert::Infallible,
io::{self, Write},
@@ -173,7 +173,7 @@ where
#[cfg(test)]
mod tests {
use super::*;
use super::JsonLines;
use crate::test_helpers::*;
use axum::{
routing::{get, post},
@@ -181,8 +181,8 @@ mod tests {
};
use futures_util::StreamExt;
use http::StatusCode;
use serde::Deserialize;
use std::error::Error;
use serde::{Deserialize, Serialize};
use std::{convert::Infallible, error::Error};
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)]
struct User {
+1 -1
View File
@@ -5,7 +5,7 @@ use axum::{
response::{IntoResponse, Response},
};
use bytes::{BufMut, Bytes, BytesMut};
use serde::Serialize;
use serde_core::Serialize;
/// A response type that holds a JSON in serialized form.
///
+2 -3
View File
@@ -2,7 +2,7 @@ use std::{any::type_name, fmt};
use super::sealed::Sealed;
use http::Uri;
use serde::Serialize;
use serde_core::Serialize;
/// A type safe path.
///
@@ -384,7 +384,6 @@ impl_second_element_is!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
#[cfg(test)]
mod tests {
use super::*;
use crate::{
extract::WithRejection,
routing::{RouterExt, TypedPath},
@@ -394,7 +393,7 @@ mod tests {
response::{IntoResponse, Response},
Router,
};
use serde::Deserialize;
use serde::{Deserialize, Serialize};
#[derive(TypedPath, Deserialize)]
#[typed_path("/users/{id}")]