replace Rc with Arc

This commit is contained in:
daddinuz 2019-05-08 21:33:11 +02:00
parent a17ff492a1
commit 9b93cc00ad
1 changed files with 3 additions and 3 deletions

View File

@ -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
} }
} }