mirror of https://github.com/fafhrd91/actix-web
replace Rc with Arc
This commit is contained in:
parent
a17ff492a1
commit
9b93cc00ad
|
@ -1,6 +1,6 @@
|
||||||
//! Json extractor/responder
|
//! Json extractor/responder
|
||||||
|
|
||||||
use std::rc::Rc;
|
use std::sync::Arc;
|
||||||
use std::{fmt, ops};
|
use std::{fmt, ops};
|
||||||
|
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
|
@ -236,7 +236,7 @@ where
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct JsonConfig {
|
pub struct JsonConfig {
|
||||||
limit: usize,
|
limit: usize,
|
||||||
ehandler: Option<Rc<Fn(JsonPayloadError, &HttpRequest) -> Error>>,
|
ehandler: Option<Arc<Fn(JsonPayloadError, &HttpRequest) -> Error>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JsonConfig {
|
impl JsonConfig {
|
||||||
|
@ -251,7 +251,7 @@ impl JsonConfig {
|
||||||
where
|
where
|
||||||
F: Fn(JsonPayloadError, &HttpRequest) -> Error + 'static,
|
F: Fn(JsonPayloadError, &HttpRequest) -> Error + 'static,
|
||||||
{
|
{
|
||||||
self.ehandler = Some(Rc::new(f));
|
self.ehandler = Some(Arc::new(f));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue