1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 07:36:43 +00:00

remove unneed Send and Sync

This commit is contained in:
Nikolay Kim 2018-06-17 08:32:22 +06:00
parent 70244c29e0
commit 0f2aac1a27
3 changed files with 4 additions and 25 deletions

View file

@ -177,11 +177,6 @@ impl<T> IdentityService<T> {
struct IdentityBox(Box<Identity>);
#[doc(hidden)]
unsafe impl Send for IdentityBox {}
#[doc(hidden)]
unsafe impl Sync for IdentityBox {}
impl<S: 'static, T: IdentityPolicy<S>> Middleware<S> for IdentityService<T> {
fn start(&mut self, req: &mut HttpRequest<S>) -> Result<Started> {
let mut req = req.clone();

View file

@ -221,11 +221,6 @@ impl<S> FromRequest<S> for Session {
struct SessionImplCell(RefCell<Box<SessionImpl>>);
#[doc(hidden)]
unsafe impl Send for SessionImplCell {}
#[doc(hidden)]
unsafe impl Sync for SessionImplCell {}
/// Session storage middleware
///
/// ```rust

View file

@ -445,20 +445,13 @@ impl fmt::Debug for ClientReader {
}
}
impl ClientReader {
#[inline]
fn as_mut(&mut self) -> &mut Inner {
unsafe { &mut *self.inner.get() }
}
}
impl Stream for ClientReader {
type Item = Message;
type Error = ProtocolError;
fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
let max_size = self.max_size;
let inner = self.as_mut();
let inner: &mut Inner = unsafe { &mut *self.inner.get() };
if inner.closed {
return Ok(Async::Ready(None));
}
@ -521,18 +514,14 @@ impl ClientWriter {
/// Write payload
#[inline]
fn write(&mut self, mut data: Binary) {
if !self.as_mut().closed {
let _ = self.as_mut().tx.unbounded_send(data.take());
let inner: &mut Inner = unsafe { &mut *self.inner.get() };
if !inner.closed {
let _ = inner.tx.unbounded_send(data.take());
} else {
warn!("Trying to write to disconnected response");
}
}
#[inline]
fn as_mut(&mut self) -> &mut Inner {
unsafe { &mut *self.inner.get() }
}
/// Send text frame
#[inline]
pub fn text<T: Into<Binary>>(&mut self, text: T) {