mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 12:00:38 +00:00
remove unneed Send and Sync
This commit is contained in:
parent
70244c29e0
commit
0f2aac1a27
3 changed files with 4 additions and 25 deletions
|
@ -177,11 +177,6 @@ impl<T> IdentityService<T> {
|
||||||
|
|
||||||
struct IdentityBox(Box<Identity>);
|
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> {
|
impl<S: 'static, T: IdentityPolicy<S>> Middleware<S> for IdentityService<T> {
|
||||||
fn start(&mut self, req: &mut HttpRequest<S>) -> Result<Started> {
|
fn start(&mut self, req: &mut HttpRequest<S>) -> Result<Started> {
|
||||||
let mut req = req.clone();
|
let mut req = req.clone();
|
||||||
|
|
|
@ -221,11 +221,6 @@ impl<S> FromRequest<S> for Session {
|
||||||
|
|
||||||
struct SessionImplCell(RefCell<Box<SessionImpl>>);
|
struct SessionImplCell(RefCell<Box<SessionImpl>>);
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
unsafe impl Send for SessionImplCell {}
|
|
||||||
#[doc(hidden)]
|
|
||||||
unsafe impl Sync for SessionImplCell {}
|
|
||||||
|
|
||||||
/// Session storage middleware
|
/// Session storage middleware
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
|
|
@ -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 {
|
impl Stream for ClientReader {
|
||||||
type Item = Message;
|
type Item = Message;
|
||||||
type Error = ProtocolError;
|
type Error = ProtocolError;
|
||||||
|
|
||||||
fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
|
fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
|
||||||
let max_size = self.max_size;
|
let max_size = self.max_size;
|
||||||
let inner = self.as_mut();
|
let inner: &mut Inner = unsafe { &mut *self.inner.get() };
|
||||||
if inner.closed {
|
if inner.closed {
|
||||||
return Ok(Async::Ready(None));
|
return Ok(Async::Ready(None));
|
||||||
}
|
}
|
||||||
|
@ -521,18 +514,14 @@ impl ClientWriter {
|
||||||
/// Write payload
|
/// Write payload
|
||||||
#[inline]
|
#[inline]
|
||||||
fn write(&mut self, mut data: Binary) {
|
fn write(&mut self, mut data: Binary) {
|
||||||
if !self.as_mut().closed {
|
let inner: &mut Inner = unsafe { &mut *self.inner.get() };
|
||||||
let _ = self.as_mut().tx.unbounded_send(data.take());
|
if !inner.closed {
|
||||||
|
let _ = inner.tx.unbounded_send(data.take());
|
||||||
} else {
|
} else {
|
||||||
warn!("Trying to write to disconnected response");
|
warn!("Trying to write to disconnected response");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn as_mut(&mut self) -> &mut Inner {
|
|
||||||
unsafe { &mut *self.inner.get() }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Send text frame
|
/// Send text frame
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn text<T: Into<Binary>>(&mut self, text: T) {
|
pub fn text<T: Into<Binary>>(&mut self, text: T) {
|
||||||
|
|
Loading…
Reference in a new issue