Skip to content

Commit eaea6f6

Browse files
committed
Add Transient impl for serde::json::Error
1 parent ac3a7fa commit eaea6f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/lib/src/serde/json.rs

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use crate::http::uri::fmt::{UriDisplay, FromUriParam, Query, Formatter as UriFor
3535
use crate::http::Status;
3636

3737
use serde::{Serialize, Deserialize};
38+
use transient::Transient;
3839

3940
#[doc(hidden)]
4041
pub use serde_json;
@@ -139,6 +140,11 @@ pub enum Error<'a> {
139140
Parse(&'a str, serde_json::error::Error),
140141
}
141142

143+
unsafe impl<'a> Transient for Error<'a> {
144+
type Static = Error<'static>;
145+
type Transience = transient::Co<'a>;
146+
}
147+
142148
impl<'a> fmt::Display for Error<'a> {
143149
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
144150
match self {

0 commit comments

Comments
 (0)