diff --git a/src/application.rs b/src/application.rs index ecd65c6e0..62ed470b3 100644 --- a/src/application.rs +++ b/src/application.rs @@ -136,7 +136,7 @@ impl Application where S: 'static { /// Create application with specific state. Application can be /// configured with builder-like pattern. /// - /// State is shared with all reousrces within same application and could be + /// State is shared with all resources within same application and could be /// accessed with `HttpRequest::state()` method. pub fn with_state(state: S) -> Application { Application { diff --git a/src/body.rs b/src/body.rs index beecf8bfa..ebd011e9c 100644 --- a/src/body.rs +++ b/src/body.rs @@ -31,7 +31,7 @@ pub enum Binary { Bytes(Bytes), /// Static slice Slice(&'static [u8]), - /// Shared stirng body + /// Shared string body SharedString(Rc), /// Shared string body #[doc(hidden)] diff --git a/src/context.rs b/src/context.rs index f518e24ad..d3fa212f5 100644 --- a/src/context.rs +++ b/src/context.rs @@ -127,7 +127,7 @@ impl HttpContext where A: Actor { } } - /// Indicate end of streamimng payload. Also this method calls `Self::close`. + /// Indicate end of streaming payload. Also this method calls `Self::close`. #[inline] pub fn write_eof(&mut self) { self.add_frame(Frame::Chunk(None)); diff --git a/src/error.rs b/src/error.rs index 29a94d4c0..0fe12a807 100644 --- a/src/error.rs +++ b/src/error.rs @@ -320,7 +320,7 @@ pub enum WsHandshakeError { /// Only get method is allowed #[fail(display="Method not allowed")] GetMethodRequired, - /// Ugrade header if not set to websocket + /// Upgrade header if not set to websocket #[fail(display="Websocket upgrade is expected")] NoWebsocketUpgrade, /// Connection header is not set to upgrade @@ -329,7 +329,7 @@ pub enum WsHandshakeError { /// Websocket version header is not set #[fail(display="Websocket version header is required")] NoVersionHeader, - /// Unsupported websockt version + /// Unsupported websocket version #[fail(display="Unsupported version")] UnsupportedVersion, /// Websocket key is not set or wrong @@ -510,7 +510,7 @@ macro_rules! ERROR_WRAP { /// Helper type that can wrap any error and generate *BAD REQUEST* response. /// /// In following example any `io::Error` will be converted into "BAD REQUEST" response -/// as oposite to *INNTERNAL SERVER ERROR* which is defined by default. +/// as opposite to *INNTERNAL SERVER ERROR* which is defined by default. /// /// ```rust /// # extern crate actix_web; diff --git a/src/handler.rs b/src/handler.rs index 8f6861e5f..561ee77b8 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -9,7 +9,7 @@ use error::Error; use httprequest::HttpRequest; use httpresponse::HttpResponse; -/// Trait defines object that could be regestered as route handler +/// Trait defines object that could be registered as route handler #[allow(unused_variables)] pub trait Handler: 'static { @@ -35,7 +35,7 @@ pub trait Responder { } #[doc(hidden)] -/// Convinience trait that convert `Future` object into `Boxed` future +/// Convenience trait that convert `Future` object into `Boxed` future pub trait AsyncResponder: Sized { fn responder(self) -> Box>; } @@ -193,7 +193,7 @@ impl Responder for Box> } } -/// Trait defines object that could be regestered as resource route +/// Trait defines object that could be registered as resource route pub(crate) trait RouteHandler: 'static { fn handle(&mut self, req: HttpRequest) -> Reply; } diff --git a/src/httprequest.rs b/src/httprequest.rs index 2498a9298..14c252748 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -222,7 +222,7 @@ impl HttpRequest { self.uri().path() } - /// Get *ConnectionInfo* for currect request. + /// Get *ConnectionInfo* for correct request. pub fn connection_info(&self) -> &ConnectionInfo { if self.as_ref().info.is_none() { let info: ConnectionInfo<'static> = unsafe{ @@ -278,7 +278,7 @@ impl HttpRequest { /// Peer socket address /// - /// Peer address is actuall socket address, if proxy is used in front of + /// Peer address is actual socket address, if proxy is used in front of /// actix http server, then peer address would be address of this proxy. /// /// To get client connection information `connection_info()` method should be used. diff --git a/src/middleware/session.rs b/src/middleware/session.rs index 9a2604dbc..ad865669f 100644 --- a/src/middleware/session.rs +++ b/src/middleware/session.rs @@ -217,7 +217,7 @@ pub struct CookieSession { inner: Rc, } -/// Errors that can occure during handling cookie session +/// Errors that can occur during handling cookie session #[derive(Fail, Debug)] pub enum CookieSessionError { /// Size of the serialized session is greater than 4000 bytes. diff --git a/src/param.rs b/src/param.rs index 530e62089..59454a76d 100644 --- a/src/param.rs +++ b/src/param.rs @@ -77,7 +77,7 @@ impl<'a> Params<'a> { } } - /// Return iterator to items in paramter container + /// Return iterator to items in parameter container pub fn iter(&self) -> Iter<(Cow<'a, str>, Cow<'a, str>)> { self.0.iter() } diff --git a/src/pipeline.rs b/src/pipeline.rs index 7335dec6a..55d2a4f8b 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -210,7 +210,7 @@ impl> StartMiddlewares { fn init(info: &mut PipelineInfo, handler: Rc>) -> PipelineState { // execute middlewares, we need this stage because middlewares could be non-async - // and we can move to next state immidietly + // and we can move to next state immediately let len = info.mws.len(); loop { if info.count == len { diff --git a/src/resource.rs b/src/resource.rs index c9e1251c0..eb783a227 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -19,7 +19,7 @@ use httpresponse::HttpResponse; /// Route uses builder-like pattern for configuration. /// During request handling, resource object iterate through all routes /// and check all predicates for specific route, if request matches all predicates route -/// route considired matched and route handler get called. +/// route considered matched and route handler get called. /// /// ```rust /// # extern crate actix_web; diff --git a/src/server/encoding.rs b/src/server/encoding.rs index e5b75c482..48f5a4092 100644 --- a/src/server/encoding.rs +++ b/src/server/encoding.rs @@ -646,7 +646,7 @@ enum TransferEncodingKind { Length(u64), /// An Encoder for when Content-Length is not known. /// - /// Appliction decides when to stop writing. + /// Application decides when to stop writing. Eof, } diff --git a/src/server/h1.rs b/src/server/h1.rs index 67ec26372..dce67755b 100644 --- a/src/server/h1.rs +++ b/src/server/h1.rs @@ -96,7 +96,7 @@ impl Http1 } } - // TODO: refacrtor + // TODO: refactor #[cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))] pub fn poll(&mut self) -> Poll<(), ()> { // keep-alive timer @@ -133,7 +133,7 @@ impl Http1 Ok(Async::Ready(ready)) => { not_ready = false; - // overide keep-alive state + // override keep-alive state if self.stream.keepalive() { self.flags.insert(Flags::KEEPALIVE); } else { diff --git a/src/server/srv.rs b/src/server/srv.rs index 050c862c0..16c7e34cd 100644 --- a/src/server/srv.rs +++ b/src/server/srv.rs @@ -268,9 +268,9 @@ impl HttpServer where U: IntoIterator + 'static, V: IntoHttpHandler, { - /// Start listening for incomming connections. + /// Start listening for incoming connections. /// - /// This method starts number of http handler workers in seperate threads. + /// This method starts number of http handler workers in separate threads. /// For each address this method starts separate thread which does `accept()` in a loop. /// /// This methods panics if no socket addresses get bound. @@ -298,7 +298,7 @@ impl HttpServer pub fn start(mut self) -> SyncAddress { if self.sockets.is_empty() { - panic!("HttpServer::bind() has to be called befor start()"); + panic!("HttpServer::bind() has to be called before start()"); } else { let addrs: Vec<(net::SocketAddr, net::TcpListener)> = self.sockets.drain().collect(); @@ -320,7 +320,7 @@ impl HttpServer } } - /// Spawn new thread and start listening for incomming connections. + /// Spawn new thread and start listening for incoming connections. /// /// This method spawns new thread and starts new actix system. Other than that it is /// similar to `start()` method. This method blocks. @@ -359,7 +359,7 @@ impl HttpServer, net::SocketAddr, H, where U: IntoIterator + 'static, V: IntoHttpHandler, { - /// Start listening for incomming tls connections. + /// Start listening for incoming tls connections. pub fn start_tls(mut self, pkcs12: ::Pkcs12) -> io::Result> { if self.sockets.is_empty() { Err(io::Error::new(io::ErrorKind::Other, "No socket addresses are bound")) @@ -398,7 +398,7 @@ impl HttpServer, net::SocketAddr, H, where U: IntoIterator + 'static, V: IntoHttpHandler, { - /// Start listening for incomming tls connections. + /// Start listening for incoming tls connections. /// /// This method sets alpn protocols to "h2" and "http/1.1" pub fn start_ssl(mut self, identity: &ParsedPkcs12) -> io::Result> { @@ -443,7 +443,7 @@ impl HttpServer, A, H, U> U: IntoIterator + 'static, V: IntoHttpHandler, { - /// Start listening for incomming connections from a stream. + /// Start listening for incoming connections from a stream. /// /// This method uses only one thread for handling incoming connections. pub fn start_incoming(mut self, stream: S, secure: bool) -> SyncAddress @@ -663,7 +663,7 @@ fn start_accept_thread(sock: net::TcpListener, addr: net::SocketAddr, backlog: i } } - // Start listening for incommin commands + // Start listening for incoming commands if let Err(err) = poll.register(®, CMD, mio::Ready::readable(), mio::PollOpt::edge()) { panic!("Can not register Registration: {}", err); diff --git a/src/test.rs b/src/test.rs index 5616ae554..fffc6d023 100644 --- a/src/test.rs +++ b/src/test.rs @@ -29,7 +29,7 @@ use server::{HttpServer, HttpHandler, IntoHttpHandler, ServerSettings}; /// The `TestServer` type. /// /// `TestServer` is very simple test server that simplify process of writing -/// integrational tests cases for actix web applications. +/// integration tests cases for actix web applications. /// /// # Examples /// @@ -61,7 +61,7 @@ impl TestServer { /// Start new test server /// - /// This methos accepts configuration method. You can add + /// This method accepts configuration method. You can add /// middlewares or set handlers for test application. pub fn new(config: F) -> Self where F: Sync + Send + 'static + Fn(&mut TestApp<()>), @@ -101,7 +101,7 @@ impl TestServer { /// Start new test server with custom application state /// - /// This methos accepts state factory and configuration method. + /// This method accepts state factory and configuration method. pub fn with_state(state: FS, config: F) -> Self where S: 'static, FS: Sync + Send + 'static + Fn() -> S, @@ -287,12 +287,12 @@ impl Default for TestRequest<()> { impl TestRequest<()> { - /// Create TestReqeust and set request uri + /// Create TestRequest and set request uri pub fn with_uri(path: &str) -> TestRequest<()> { TestRequest::default().uri(path) } - /// Create TestReqeust and set header + /// Create TestRequest and set header pub fn with_header(key: K, value: V) -> TestRequest<()> where HeaderName: HttpTryFrom, HeaderValue: HttpTryFrom diff --git a/src/ws/frame.rs b/src/ws/frame.rs index 823292a98..20b98b638 100644 --- a/src/ws/frame.rs +++ b/src/ws/frame.rs @@ -28,7 +28,7 @@ pub(crate) struct Frame { impl Frame { - /// Desctructe frame + /// Destruct frame pub fn unpack(self) -> (bool, OpCode, Binary) { (self.finished, self.opcode, self.payload) }