1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 16:55:08 +02:00

apply standard formatting

This commit is contained in:
Rob Ede
2023-07-17 02:38:12 +01:00
parent 60c76c5e10
commit 79a38e0628
138 changed files with 916 additions and 1180 deletions

View File

@ -70,15 +70,14 @@ mod inner {
task::{Context, Poll},
};
use actix_codec::Framed;
use actix_service::{IntoService, Service};
use futures_core::stream::Stream;
use local_channel::mpsc;
use pin_project_lite::pin_project;
use tracing::debug;
use actix_codec::Framed;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio_util::codec::{Decoder, Encoder};
use tracing::debug;
use crate::{body::BoxBody, Response};
@ -413,9 +412,7 @@ mod inner {
}
State::Error(_) => {
// flush write buffer
if !this.framed.is_write_buf_empty()
&& this.framed.flush(cx).is_pending()
{
if !this.framed.is_write_buf_empty() && this.framed.flush(cx).is_pending() {
return Poll::Pending;
}
Poll::Ready(Err(this.state.take_error()))

View File

@ -221,9 +221,10 @@ impl Parser {
#[cfg(test)]
mod tests {
use super::*;
use bytes::Bytes;
use super::*;
struct F {
finished: bool,
opcode: OpCode,

View File

@ -8,8 +8,7 @@ use std::io;
use derive_more::{Display, Error, From};
use http::{header, Method, StatusCode};
use crate::body::BoxBody;
use crate::{header::HeaderValue, RequestHead, Response, ResponseBuilder};
use crate::{body::BoxBody, header::HeaderValue, RequestHead, Response, ResponseBuilder};
mod codec;
mod dispatcher;
@ -17,10 +16,12 @@ mod frame;
mod mask;
mod proto;
pub use self::codec::{Codec, Frame, Item, Message};
pub use self::dispatcher::Dispatcher;
pub use self::frame::Parser;
pub use self::proto::{hash_key, CloseCode, CloseReason, OpCode};
pub use self::{
codec::{Codec, Frame, Item, Message},
dispatcher::Dispatcher,
frame::Parser,
proto::{hash_key, CloseCode, CloseReason, OpCode},
};
/// WebSocket protocol errors.
#[derive(Debug, Display, Error, From)]
@ -219,10 +220,8 @@ pub fn handshake_response(req: &RequestHead) -> ResponseBuilder {
#[cfg(test)]
mod tests {
use crate::{header, Method};
use super::*;
use crate::test::TestRequest;
use crate::{header, test::TestRequest, Method};
#[test]
fn test_handshake() {