From f9fcf56d5c525956572051303ab8bce793cb4456 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Mon, 28 Dec 2020 04:37:53 +0800 Subject: [PATCH 1/6] reduce branch in actix_http::h1::codec (#1854) --- actix-http/src/h1/codec.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actix-http/src/h1/codec.rs b/actix-http/src/h1/codec.rs index c9a62dc30..d5035df26 100644 --- a/actix-http/src/h1/codec.rs +++ b/actix-http/src/h1/codec.rs @@ -111,8 +111,8 @@ impl Decoder for Codec { type Error = ParseError; fn decode(&mut self, src: &mut BytesMut) -> Result, Self::Error> { - if self.payload.is_some() { - Ok(match self.payload.as_mut().unwrap().decode(src)? { + if let Some(ref mut payload) = self.payload { + Ok(match payload.decode(src)? { Some(PayloadItem::Chunk(chunk)) => Some(Message::Chunk(Some(chunk))), Some(PayloadItem::Eof) => { self.payload.take(); From 8c9ea43e232b55234fe24b04b023a7a7d5f18bd4 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 27 Dec 2020 20:53:19 +0000 Subject: [PATCH 2/6] address clippy warnings --- actix-files/CHANGES.md | 1 + actix-files/src/range.rs | 41 +++++++++++++++++++---------------- src/middleware/errhandlers.rs | 1 + tests/test_httpserver.rs | 1 + 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/actix-files/CHANGES.md b/actix-files/CHANGES.md index 86e5e6563..49768419b 100644 --- a/actix-files/CHANGES.md +++ b/actix-files/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2020-xx-xx +* `HttpRange::parse` now has its own error type. ## 0.5.0 - 2020-12-26 diff --git a/actix-files/src/range.rs b/actix-files/src/range.rs index e891ca7ec..e420ce414 100644 --- a/actix-files/src/range.rs +++ b/actix-files/src/range.rs @@ -1,3 +1,5 @@ +use derive_more::{Display, Error}; + /// HTTP Range header representation. #[derive(Debug, Clone, Copy)] pub struct HttpRange { @@ -11,17 +13,21 @@ pub struct HttpRange { const PREFIX: &str = "bytes="; const PREFIX_LEN: usize = 6; +#[derive(Debug, Clone, Display, Error)] +#[display(fmt = "Parse HTTP Range failed")] +pub struct ParseRangeErr(#[error(not(source))] ()); + impl HttpRange { /// Parses Range HTTP header string as per RFC 2616. /// /// `header` is HTTP Range header (e.g. `bytes=bytes=0-9`). /// `size` is full size of response (file). - pub fn parse(header: &str, size: u64) -> Result, ()> { + pub fn parse(header: &str, size: u64) -> Result, ParseRangeErr> { if header.is_empty() { return Ok(Vec::new()); } if !header.starts_with(PREFIX) { - return Err(()); + return Err(ParseRangeErr(())); } let size_sig = size as i64; @@ -34,13 +40,14 @@ impl HttpRange { .map(|ra| { let mut start_end_iter = ra.split('-'); - let start_str = start_end_iter.next().ok_or(())?.trim(); - let end_str = start_end_iter.next().ok_or(())?.trim(); + let start_str = start_end_iter.next().ok_or(ParseRangeErr(()))?.trim(); + let end_str = start_end_iter.next().ok_or(ParseRangeErr(()))?.trim(); if start_str.is_empty() { // If no start is specified, end specifies the // range start relative to the end of the file. - let mut length: i64 = end_str.parse().map_err(|_| ())?; + let mut length: i64 = + end_str.parse().map_err(|_| ParseRangeErr(()))?; if length > size_sig { length = size_sig; @@ -51,10 +58,10 @@ impl HttpRange { length: length as u64, })) } else { - let start: i64 = start_str.parse().map_err(|_| ())?; + let start: i64 = start_str.parse().map_err(|_| ParseRangeErr(()))?; if start < 0 { - return Err(()); + return Err(ParseRangeErr(())); } if start >= size_sig { no_overlap = true; @@ -65,10 +72,11 @@ impl HttpRange { // If no end is specified, range extends to end of the file. size_sig - start } else { - let mut end: i64 = end_str.parse().map_err(|_| ())?; + let mut end: i64 = + end_str.parse().map_err(|_| ParseRangeErr(()))?; if start > end { - return Err(()); + return Err(ParseRangeErr(())); } if end >= size_sig { @@ -89,7 +97,7 @@ impl HttpRange { let ranges: Vec = all_ranges.into_iter().filter_map(|x| x).collect(); if no_overlap && ranges.is_empty() { - return Err(()); + return Err(ParseRangeErr(())); } Ok(ranges) @@ -333,8 +341,7 @@ mod tests { if expected.is_empty() { continue; } else { - assert!( - false, + panic!( "parse({}, {}) returned error {:?}", header, size, @@ -346,28 +353,24 @@ mod tests { let got = res.unwrap(); if got.len() != expected.len() { - assert!( - false, + panic!( "len(parseRange({}, {})) = {}, want {}", header, size, got.len(), expected.len() ); - continue; } for i in 0..expected.len() { if got[i].start != expected[i].start { - assert!( - false, + panic!( "parseRange({}, {})[{}].start = {}, want {}", header, size, i, got[i].start, expected[i].start ) } if got[i].length != expected[i].length { - assert!( - false, + panic!( "parseRange({}, {})[{}].length = {}, want {}", header, size, i, got[i].length, expected[i].length ) diff --git a/src/middleware/errhandlers.rs b/src/middleware/errhandlers.rs index c0cb9594e..d2d3b0d8c 100644 --- a/src/middleware/errhandlers.rs +++ b/src/middleware/errhandlers.rs @@ -179,6 +179,7 @@ mod tests { assert_eq!(resp.headers().get(CONTENT_TYPE).unwrap(), "0001"); } + #[allow(clippy::unnecessary_wraps)] fn render_500_async( mut res: ServiceResponse, ) -> Result> { diff --git a/tests/test_httpserver.rs b/tests/test_httpserver.rs index 118640aca..d164f4445 100644 --- a/tests/test_httpserver.rs +++ b/tests/test_httpserver.rs @@ -63,6 +63,7 @@ async fn test_start() { let _ = sys.stop(); } +#[allow(clippy::unnecessary_wraps)] #[cfg(feature = "openssl")] fn ssl_acceptor() -> std::io::Result { use open_ssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; From 093d3a6c59338045f46ee85f1a3ec3b028f97712 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 27 Dec 2020 23:23:30 +0000 Subject: [PATCH 3/6] remove deprecated on_connect methods (#1857) --- actix-http/CHANGES.md | 7 +++++++ actix-http/src/builder.rs | 23 ----------------------- actix-http/src/clinu/mod.rs | 0 actix-http/src/h1/dispatcher.rs | 18 ------------------ actix-http/src/h1/service.rs | 23 ----------------------- actix-http/src/h2/dispatcher.rs | 10 ---------- actix-http/src/h2/service.rs | 25 ------------------------- actix-http/src/helpers.rs | 14 -------------- actix-http/src/service.rs | 30 +----------------------------- actix-http/tests/test_openssl.rs | 2 -- actix-http/tests/test_server.rs | 2 -- 11 files changed, 8 insertions(+), 146 deletions(-) create mode 100644 actix-http/src/clinu/mod.rs diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 81577688d..c43246bb0 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -4,6 +4,13 @@ ### Changed * Bumped `rand` to `0.8` +### Removed +* Deprecated `on_connect` methods have been removed. Prefer the new + `on_connect_ext` technique. [#1857] + +[#1857]: https://github.com/actix/actix-web/pull/1857 + + ## 2.2.0 - 2020-11-25 ### Added * HttpResponse builders for 1xx status codes. [#1768] diff --git a/actix-http/src/builder.rs b/actix-http/src/builder.rs index b28c69761..df1b332c1 100644 --- a/actix-http/src/builder.rs +++ b/actix-http/src/builder.rs @@ -10,7 +10,6 @@ use crate::config::{KeepAlive, ServiceConfig}; use crate::error::Error; use crate::h1::{Codec, ExpectHandler, H1Service, UpgradeHandler}; use crate::h2::H2Service; -use crate::helpers::{Data, DataFactory}; use crate::request::Request; use crate::response::Response; use crate::service::HttpService; @@ -28,8 +27,6 @@ pub struct HttpServiceBuilder> { local_addr: Option, expect: X, upgrade: Option, - // DEPRECATED: in favor of on_connect_ext - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, S)>, } @@ -51,7 +48,6 @@ where local_addr: None, expect: ExpectHandler, upgrade: None, - on_connect: None, on_connect_ext: None, _t: PhantomData, } @@ -141,7 +137,6 @@ where local_addr: self.local_addr, expect: expect.into_factory(), upgrade: self.upgrade, - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } @@ -171,26 +166,11 @@ where local_addr: self.local_addr, expect: self.expect, upgrade: Some(upgrade.into_factory()), - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } } - /// Set on-connect callback. - /// - /// Called once per connection. Return value of the call is stored in request extensions. - /// - /// *SOFT DEPRECATED*: Prefer the `on_connect_ext` style callback. - pub fn on_connect(mut self, f: F) -> Self - where - F: Fn(&T) -> I + 'static, - I: Clone + 'static, - { - self.on_connect = Some(Rc::new(move |io| Box::new(Data(f(io))))); - self - } - /// Sets the callback to be run on connection establishment. /// /// Has mutable access to a data container that will be merged into request extensions. @@ -224,7 +204,6 @@ where H1Service::with_config(cfg, service.into_factory()) .expect(self.expect) .upgrade(self.upgrade) - .on_connect(self.on_connect) .on_connect_ext(self.on_connect_ext) } @@ -247,7 +226,6 @@ where ); H2Service::with_config(cfg, service.into_factory()) - .on_connect(self.on_connect) .on_connect_ext(self.on_connect_ext) } @@ -272,7 +250,6 @@ where HttpService::with_config(cfg, service.into_factory()) .expect(self.expect) .upgrade(self.upgrade) - .on_connect(self.on_connect) .on_connect_ext(self.on_connect_ext) } } diff --git a/actix-http/src/clinu/mod.rs b/actix-http/src/clinu/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index ea8f91e0d..91e208aac 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -19,7 +19,6 @@ use crate::cloneable::CloneableService; use crate::config::ServiceConfig; use crate::error::{DispatchError, Error}; use crate::error::{ParseError, PayloadError}; -use crate::helpers::DataFactory; use crate::httpmessage::HttpMessage; use crate::request::Request; use crate::response::Response; @@ -96,7 +95,6 @@ where service: CloneableService, expect: CloneableService, upgrade: Option>, - on_connect: Option>, on_connect_data: Extensions, flags: Flags, peer_addr: Option, @@ -184,7 +182,6 @@ where service: CloneableService, expect: CloneableService, upgrade: Option>, - on_connect: Option>, on_connect_data: Extensions, peer_addr: Option, ) -> Self { @@ -197,7 +194,6 @@ where service, expect, upgrade, - on_connect, on_connect_data, peer_addr, ) @@ -213,7 +209,6 @@ where service: CloneableService, expect: CloneableService, upgrade: Option>, - on_connect: Option>, on_connect_data: Extensions, peer_addr: Option, ) -> Self { @@ -246,7 +241,6 @@ where service, expect, upgrade, - on_connect, on_connect_data, flags, peer_addr, @@ -572,12 +566,6 @@ where let pl = this.codec.message_type(); req.head_mut().peer_addr = *this.peer_addr; - // DEPRECATED - // set on_connect data - if let Some(ref on_connect) = this.on_connect { - on_connect.set(&mut req.extensions_mut()); - } - // merge on_connect_ext data into request extensions req.extensions_mut().drain_from(this.on_connect_data); @@ -1038,7 +1026,6 @@ mod tests { CloneableService::new(ok_service()), CloneableService::new(ExpectHandler), None, - None, Extensions::new(), None, ); @@ -1079,7 +1066,6 @@ mod tests { CloneableService::new(echo_path_service()), CloneableService::new(ExpectHandler), None, - None, Extensions::new(), None, ); @@ -1134,7 +1120,6 @@ mod tests { CloneableService::new(echo_path_service()), CloneableService::new(ExpectHandler), None, - None, Extensions::new(), None, ); @@ -1184,7 +1169,6 @@ mod tests { CloneableService::new(echo_payload_service()), CloneableService::new(ExpectHandler), None, - None, Extensions::new(), None, ); @@ -1256,7 +1240,6 @@ mod tests { CloneableService::new(echo_path_service()), CloneableService::new(ExpectHandler), None, - None, Extensions::new(), None, ); @@ -1316,7 +1299,6 @@ mod tests { CloneableService::new(ok_service()), CloneableService::new(ExpectHandler), Some(CloneableService::new(UpgradeHandler(PhantomData))), - None, Extensions::new(), None, ); diff --git a/actix-http/src/h1/service.rs b/actix-http/src/h1/service.rs index cbba0609c..919a5d932 100644 --- a/actix-http/src/h1/service.rs +++ b/actix-http/src/h1/service.rs @@ -15,7 +15,6 @@ use crate::body::MessageBody; use crate::cloneable::CloneableService; use crate::config::ServiceConfig; use crate::error::{DispatchError, Error}; -use crate::helpers::DataFactory; use crate::request::Request; use crate::response::Response; use crate::{ConnectCallback, Extensions}; @@ -30,7 +29,6 @@ pub struct H1Service> { cfg: ServiceConfig, expect: X, upgrade: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B)>, } @@ -53,7 +51,6 @@ where srv: service.into_factory(), expect: ExpectHandler, upgrade: None, - on_connect: None, on_connect_ext: None, _t: PhantomData, } @@ -215,7 +212,6 @@ where cfg: self.cfg, srv: self.srv, upgrade: self.upgrade, - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } @@ -232,21 +228,11 @@ where cfg: self.cfg, srv: self.srv, expect: self.expect, - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } } - /// Set on connect callback. - pub(crate) fn on_connect( - mut self, - f: Option Box>>, - ) -> Self { - self.on_connect = f; - self - } - /// Set on connect callback. pub(crate) fn on_connect_ext(mut self, f: Option>>) -> Self { self.on_connect_ext = f; @@ -284,7 +270,6 @@ where fut_upg: self.upgrade.as_ref().map(|f| f.new_service(())), expect: None, upgrade: None, - on_connect: self.on_connect.clone(), on_connect_ext: self.on_connect_ext.clone(), cfg: Some(self.cfg.clone()), _t: PhantomData, @@ -314,7 +299,6 @@ where fut_upg: Option, expect: Option, upgrade: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, cfg: Option, _t: PhantomData<(T, B)>, @@ -371,7 +355,6 @@ where service, this.expect.take().unwrap(), this.upgrade.take(), - this.on_connect.clone(), this.on_connect_ext.clone(), ) })) @@ -383,7 +366,6 @@ pub struct H1ServiceHandler { srv: CloneableService, expect: CloneableService, upgrade: Option>, - on_connect: Option Box>>, on_connect_ext: Option>>, cfg: ServiceConfig, _t: PhantomData<(T, B)>, @@ -405,7 +387,6 @@ where srv: S, expect: X, upgrade: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, ) -> H1ServiceHandler { H1ServiceHandler { @@ -413,7 +394,6 @@ where expect: CloneableService::new(expect), upgrade: upgrade.map(CloneableService::new), cfg, - on_connect, on_connect_ext, _t: PhantomData, } @@ -480,8 +460,6 @@ where } fn call(&mut self, (io, addr): Self::Request) -> Self::Future { - let deprecated_on_connect = self.on_connect.as_ref().map(|handler| handler(&io)); - let mut connect_extensions = Extensions::new(); if let Some(ref handler) = self.on_connect_ext { // run on_connect_ext callback, populating connect extensions @@ -494,7 +472,6 @@ where self.srv.clone(), self.expect.clone(), self.upgrade.clone(), - deprecated_on_connect, connect_extensions, addr, ) diff --git a/actix-http/src/h2/dispatcher.rs b/actix-http/src/h2/dispatcher.rs index 594339121..7a0be9492 100644 --- a/actix-http/src/h2/dispatcher.rs +++ b/actix-http/src/h2/dispatcher.rs @@ -18,7 +18,6 @@ use crate::body::{BodySize, MessageBody, ResponseBody}; use crate::cloneable::CloneableService; use crate::config::ServiceConfig; use crate::error::{DispatchError, Error}; -use crate::helpers::DataFactory; use crate::httpmessage::HttpMessage; use crate::message::ResponseHead; use crate::payload::Payload; @@ -36,7 +35,6 @@ where { service: CloneableService, connection: Connection, - on_connect: Option>, on_connect_data: Extensions, config: ServiceConfig, peer_addr: Option, @@ -57,7 +55,6 @@ where pub(crate) fn new( service: CloneableService, connection: Connection, - on_connect: Option>, on_connect_data: Extensions, config: ServiceConfig, timeout: Option, @@ -84,7 +81,6 @@ where config, peer_addr, connection, - on_connect, on_connect_data, ka_expire, ka_timer, @@ -134,12 +130,6 @@ where head.headers = parts.headers.into(); head.peer_addr = this.peer_addr; - // DEPRECATED - // set on_connect data - if let Some(ref on_connect) = this.on_connect { - on_connect.set(&mut req.extensions_mut()); - } - // merge on_connect_ext data into request extensions req.extensions_mut().drain_from(&mut this.on_connect_data); diff --git a/actix-http/src/h2/service.rs b/actix-http/src/h2/service.rs index 3103127b4..b1fb9a634 100644 --- a/actix-http/src/h2/service.rs +++ b/actix-http/src/h2/service.rs @@ -20,7 +20,6 @@ use crate::body::MessageBody; use crate::cloneable::CloneableService; use crate::config::ServiceConfig; use crate::error::{DispatchError, Error}; -use crate::helpers::DataFactory; use crate::request::Request; use crate::response::Response; use crate::{ConnectCallback, Extensions}; @@ -31,7 +30,6 @@ use super::dispatcher::Dispatcher; pub struct H2Service { srv: S, cfg: ServiceConfig, - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B)>, } @@ -51,23 +49,12 @@ where ) -> Self { H2Service { cfg, - on_connect: None, on_connect_ext: None, srv: service.into_factory(), _t: PhantomData, } } - /// Set on connect callback. - - pub(crate) fn on_connect( - mut self, - f: Option Box>>, - ) -> Self { - self.on_connect = f; - self - } - /// Set on connect callback. pub(crate) fn on_connect_ext(mut self, f: Option>>) -> Self { self.on_connect_ext = f; @@ -212,7 +199,6 @@ where H2ServiceResponse { fut: self.srv.new_service(()), cfg: Some(self.cfg.clone()), - on_connect: self.on_connect.clone(), on_connect_ext: self.on_connect_ext.clone(), _t: PhantomData, } @@ -225,7 +211,6 @@ pub struct H2ServiceResponse { #[pin] fut: S::Future, cfg: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B)>, } @@ -248,7 +233,6 @@ where let this = self.as_mut().project(); H2ServiceHandler::new( this.cfg.take().unwrap(), - this.on_connect.clone(), this.on_connect_ext.clone(), service, ) @@ -260,7 +244,6 @@ where pub struct H2ServiceHandler { srv: CloneableService, cfg: ServiceConfig, - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B)>, } @@ -275,13 +258,11 @@ where { fn new( cfg: ServiceConfig, - on_connect: Option Box>>, on_connect_ext: Option>>, srv: S, ) -> H2ServiceHandler { H2ServiceHandler { cfg, - on_connect, on_connect_ext, srv: CloneableService::new(srv), _t: PhantomData, @@ -312,8 +293,6 @@ where } fn call(&mut self, (io, addr): Self::Request) -> Self::Future { - let deprecated_on_connect = self.on_connect.as_ref().map(|handler| handler(&io)); - let mut connect_extensions = Extensions::new(); if let Some(ref handler) = self.on_connect_ext { // run on_connect_ext callback, populating connect extensions @@ -325,7 +304,6 @@ where Some(self.srv.clone()), Some(self.cfg.clone()), addr, - deprecated_on_connect, Some(connect_extensions), server::handshake(io), ), @@ -343,7 +321,6 @@ where Option>, Option, Option, - Option>, Option, Handshake, ), @@ -379,7 +356,6 @@ where ref mut srv, ref mut config, ref peer_addr, - ref mut on_connect, ref mut on_connect_data, ref mut handshake, ) => match Pin::new(handshake).poll(cx) { @@ -387,7 +363,6 @@ where self.state = State::Incoming(Dispatcher::new( srv.take().unwrap(), conn, - on_connect.take(), on_connect_data.take().unwrap(), config.take().unwrap(), None, diff --git a/actix-http/src/helpers.rs b/actix-http/src/helpers.rs index ac0e0f118..13195f7db 100644 --- a/actix-http/src/helpers.rs +++ b/actix-http/src/helpers.rs @@ -3,8 +3,6 @@ use std::io; use bytes::{BufMut, BytesMut}; use http::Version; -use crate::extensions::Extensions; - const DIGITS_START: u8 = b'0'; pub(crate) fn write_status_line(version: Version, n: u16, bytes: &mut BytesMut) { @@ -56,18 +54,6 @@ impl<'a> io::Write for Writer<'a> { } } -pub(crate) trait DataFactory { - fn set(&self, ext: &mut Extensions); -} - -pub(crate) struct Data(pub(crate) T); - -impl DataFactory for Data { - fn set(&self, ext: &mut Extensions) { - ext.insert(self.0.clone()) - } -} - #[cfg(test)] mod tests { use std::str::from_utf8; diff --git a/actix-http/src/service.rs b/actix-http/src/service.rs index 75745209c..527ed3833 100644 --- a/actix-http/src/service.rs +++ b/actix-http/src/service.rs @@ -17,7 +17,6 @@ use crate::builder::HttpServiceBuilder; use crate::cloneable::CloneableService; use crate::config::{KeepAlive, ServiceConfig}; use crate::error::{DispatchError, Error}; -use crate::helpers::DataFactory; use crate::request::Request; use crate::response::Response; use crate::{h1, h2::Dispatcher, ConnectCallback, Extensions, Protocol}; @@ -28,8 +27,6 @@ pub struct HttpService cfg: ServiceConfig, expect: X, upgrade: Option, - // DEPRECATED: in favor of on_connect_ext - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B)>, } @@ -67,7 +64,6 @@ where srv: service.into_factory(), expect: h1::ExpectHandler, upgrade: None, - on_connect: None, on_connect_ext: None, _t: PhantomData, } @@ -83,7 +79,6 @@ where srv: service.into_factory(), expect: h1::ExpectHandler, upgrade: None, - on_connect: None, on_connect_ext: None, _t: PhantomData, } @@ -116,7 +111,6 @@ where cfg: self.cfg, srv: self.srv, upgrade: self.upgrade, - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } @@ -142,21 +136,11 @@ where cfg: self.cfg, srv: self.srv, expect: self.expect, - on_connect: self.on_connect, on_connect_ext: self.on_connect_ext, _t: PhantomData, } } - /// Set on connect callback. - pub(crate) fn on_connect( - mut self, - f: Option Box>>, - ) -> Self { - self.on_connect = f; - self - } - /// Set connect callback with mutable access to request data container. pub(crate) fn on_connect_ext(mut self, f: Option>>) -> Self { self.on_connect_ext = f; @@ -366,7 +350,6 @@ where fut_upg: self.upgrade.as_ref().map(|f| f.new_service(())), expect: None, upgrade: None, - on_connect: self.on_connect.clone(), on_connect_ext: self.on_connect_ext.clone(), cfg: self.cfg.clone(), _t: PhantomData, @@ -391,7 +374,6 @@ pub struct HttpServiceResponse< fut_upg: Option, expect: Option, upgrade: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, cfg: ServiceConfig, _t: PhantomData<(T, B)>, @@ -451,7 +433,6 @@ where service, this.expect.take().unwrap(), this.upgrade.take(), - this.on_connect.clone(), this.on_connect_ext.clone(), ) })) @@ -464,7 +445,6 @@ pub struct HttpServiceHandler { expect: CloneableService, upgrade: Option>, cfg: ServiceConfig, - on_connect: Option Box>>, on_connect_ext: Option>>, _t: PhantomData<(T, B, X)>, } @@ -486,12 +466,10 @@ where srv: S, expect: X, upgrade: Option, - on_connect: Option Box>>, on_connect_ext: Option>>, ) -> HttpServiceHandler { HttpServiceHandler { cfg, - on_connect, on_connect_ext, srv: CloneableService::new(srv), expect: CloneableService::new(expect), @@ -564,7 +542,6 @@ where fn call(&mut self, (io, proto, peer_addr): Self::Request) -> Self::Future { let mut connect_extensions = Extensions::new(); - let deprecated_on_connect = self.on_connect.as_ref().map(|handler| handler(&io)); if let Some(ref handler) = self.on_connect_ext { handler(&io, &mut connect_extensions); } @@ -575,7 +552,6 @@ where server::handshake(io), self.cfg.clone(), self.srv.clone(), - deprecated_on_connect, connect_extensions, peer_addr, ))), @@ -588,7 +564,6 @@ where self.srv.clone(), self.expect.clone(), self.upgrade.clone(), - deprecated_on_connect, connect_extensions, peer_addr, )), @@ -617,7 +592,6 @@ where Handshake, ServiceConfig, CloneableService, - Option>, Extensions, Option, )>, @@ -694,12 +668,10 @@ where } else { panic!() }; - let (_, cfg, srv, on_connect, on_connect_data, peer_addr) = - data.take().unwrap(); + let (_, cfg, srv, on_connect_data, peer_addr) = data.take().unwrap(); self.set(State::H2(Dispatcher::new( srv, conn, - on_connect, on_connect_data, cfg, None, diff --git a/actix-http/tests/test_openssl.rs b/actix-http/tests/test_openssl.rs index 05f01d240..6b80bad0a 100644 --- a/actix-http/tests/test_openssl.rs +++ b/actix-http/tests/test_openssl.rs @@ -410,10 +410,8 @@ async fn test_h2_service_error() { async fn test_h2_on_connect() { let srv = test_server(move || { HttpService::build() - .on_connect(|_| 10usize) .on_connect_ext(|_, data| data.insert(20isize)) .h2(|req: Request| { - assert!(req.extensions().contains::()); assert!(req.extensions().contains::()); ok::<_, ()>(Response::Ok().finish()) }) diff --git a/actix-http/tests/test_server.rs b/actix-http/tests/test_server.rs index de6368fda..44794e199 100644 --- a/actix-http/tests/test_server.rs +++ b/actix-http/tests/test_server.rs @@ -662,10 +662,8 @@ async fn test_h1_service_error() { async fn test_h1_on_connect() { let srv = test_server(|| { HttpService::build() - .on_connect(|_| 10usize) .on_connect_ext(|_, data| data.insert(20isize)) .h1(|req: Request| { - assert!(req.extensions().contains::()); assert!(req.extensions().contains::()); future::ok::<_, ()>(Response::Ok().finish()) }) From 2a2a20c3e740a47b1534662500e9d3c065bdfa79 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 28 Dec 2020 00:44:15 +0000 Subject: [PATCH 4/6] bump msrv to 1.46 (#1858) --- .github/workflows/linux.yml | 18 +++++++++-- .github/workflows/macos.yml | 12 ++++++++ .github/workflows/windows.yml | 12 ++++++++ CHANGES.md | 1 + README.md | 4 +-- actix-files/README.md | 4 +-- actix-http-test/README.md | 2 +- actix-http/README.md | 2 +- .../src/header/common/content_disposition.rs | 3 +- actix-http/src/lib.rs | 1 - actix-web-codegen/README.md | 4 +-- actix-web-codegen/tests/trybuild.rs | 30 +++++-------------- .../route-missing-method-fail-msrv.rs | 1 - .../route-missing-method-fail-msrv.stderr | 11 ------- awc/README.md | 2 +- src/lib.rs | 4 +-- 16 files changed, 59 insertions(+), 52 deletions(-) delete mode 120000 actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.rs delete mode 100644 actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.stderr diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a068070ff..53f22df63 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: version: - - 1.42.0 # MSRV + - 1.46.0 # MSRV - stable - nightly @@ -30,6 +30,13 @@ jobs: profile: minimal override: true + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1.0.1 + - name: check build uses: actions-rs/cargo@v1 with: @@ -58,12 +65,17 @@ jobs: args: --package=awc --no-default-features --features=rustls -- --nocapture - name: Generate coverage file - if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') + if: matrix.version == 'stable' && github.ref == 'refs/heads/master' run: | cargo install cargo-tarpaulin --vers "^0.13" cargo tarpaulin --out Xml - name: Upload to Codecov - if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') + if: matrix.version == 'stable' && github.ref == 'refs/heads/master' uses: codecov/codecov-action@v1 with: file: cobertura.xml + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dc8558ac1..6b5366faf 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -29,6 +29,13 @@ jobs: profile: minimal override: true + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1.0.1 + - name: check build uses: actions-rs/cargo@v1 with: @@ -42,3 +49,8 @@ jobs: args: --all --all-features --no-fail-fast -- --nocapture --skip=test_h2_content_length --skip=test_reading_deflate_encoding_large_random_rustls + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d53d50a61..d3de72a61 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,6 +41,13 @@ jobs: Get-ChildItem C:\vcpkg\installed\x64-windows\bin Get-ChildItem C:\vcpkg\installed\x64-windows\lib + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1.0.1 + - name: check build uses: actions-rs/cargo@v1 with: @@ -62,3 +69,8 @@ jobs: --skip=test_connection_force_close --skip=test_connection_server_close --skip=test_connection_wait_queue_force_close + + - name: Clear the cargo caches + run: | + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/CHANGES.md b/CHANGES.md index da04c5aa3..fa56acc17 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ ### Changed * Bumped `rand` to `0.8` * Rename `Handler` to `HandlerService` and rename `Factory` to `Handler`. [#1852] +* MSRV is now 1.46.0. ### Fixed * added the actual parsing error to `test::read_body_json` [#1812] diff --git a/README.md b/README.md index b9f2b7594..62ee50243 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web) [![Documentation](https://docs.rs/actix-web/badge.svg?version=3.3.2)](https://docs.rs/actix-web/3.3.2) -[![Version](https://img.shields.io/badge/rustc-1.42+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html) +[![Version](https://img.shields.io/badge/rustc-1.46+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html) ![License](https://img.shields.io/crates/l/actix-web.svg) [![Dependency Status](https://deps.rs/crate/actix-web/3.3.2/status.svg)](https://deps.rs/crate/actix-web/3.3.2)
@@ -34,7 +34,7 @@ * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/)) * Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html) * Supports [Actix actor framework](https://github.com/actix/actix) -* Runs on stable Rust 1.42+ +* Runs on stable Rust 1.46+ ## Documentation diff --git a/actix-files/README.md b/actix-files/README.md index 2953b4458..463f20224 100644 --- a/actix-files/README.md +++ b/actix-files/README.md @@ -4,7 +4,7 @@ [![crates.io](https://img.shields.io/crates/v/actix-files?label=latest)](https://crates.io/crates/actix-files) [![Documentation](https://docs.rs/actix-files/badge.svg?version=0.5.0)](https://docs.rs/actix-files/0.5.0) -[![Version](https://img.shields.io/badge/rustc-1.42+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html) +[![Version](https://img.shields.io/badge/rustc-1.46+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html) ![License](https://img.shields.io/crates/l/actix-files.svg)
[![dependency status](https://deps.rs/crate/actix-files/0.5.0/status.svg)](https://deps.rs/crate/actix-files/0.5.0) @@ -16,4 +16,4 @@ - [API Documentation](https://docs.rs/actix-files/) - [Example Project](https://github.com/actix/examples/tree/master/static_index) - [Chat on Gitter](https://gitter.im/actix/actix-web) -- Minimum supported Rust version: 1.42 or later +- Minimum supported Rust version: 1.46 or later diff --git a/actix-http-test/README.md b/actix-http-test/README.md index c847c8515..bca9a7976 100644 --- a/actix-http-test/README.md +++ b/actix-http-test/README.md @@ -12,4 +12,4 @@ - [API Documentation](https://docs.rs/actix-http-test) - [Chat on Gitter](https://gitter.im/actix/actix-web) -- Minimum Supported Rust Version (MSRV): 1.42.0 +- Minimum Supported Rust Version (MSRV): 1.46.0 diff --git a/actix-http/README.md b/actix-http/README.md index 9103cd184..9dfb85e24 100644 --- a/actix-http/README.md +++ b/actix-http/README.md @@ -12,7 +12,7 @@ - [API Documentation](https://docs.rs/actix-http) - [Chat on Gitter](https://gitter.im/actix/actix-web) -- Minimum Supported Rust Version (MSRV): 1.42.0 +- Minimum Supported Rust Version (MSRV): 1.46.0 ## Example diff --git a/actix-http/src/header/common/content_disposition.rs b/actix-http/src/header/common/content_disposition.rs index 826cfef63..4c512acbe 100644 --- a/actix-http/src/header/common/content_disposition.rs +++ b/actix-http/src/header/common/content_disposition.rs @@ -318,9 +318,8 @@ impl ContentDisposition { return Err(crate::error::ParseError::Header); } left = new_left; - if param_name.ends_with('*') { + if let Some(param_name) = param_name.strip_suffix('*') { // extended parameters - let param_name = ¶m_name[..param_name.len() - 1]; // trim asterisk let (ext_value, new_left) = split_once_and_trim(left, ';'); left = new_left; let ext_value = header::parse_extended_value(ext_value)?; diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index 89d64fb77..94cc50a76 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -7,7 +7,6 @@ clippy::new_without_default, clippy::borrow_interior_mutable_const )] -#![allow(clippy::manual_strip)] // Allow this to keep MSRV(1.42). #![doc(html_logo_url = "https://actix.rs/img/logo.png")] #![doc(html_favicon_url = "https://actix.rs/favicon.ico")] diff --git a/actix-web-codegen/README.md b/actix-web-codegen/README.md index 283591e86..887502075 100644 --- a/actix-web-codegen/README.md +++ b/actix-web-codegen/README.md @@ -4,7 +4,7 @@ [![crates.io](https://meritbadge.herokuapp.com/actix-web-codegen)](https://crates.io/crates/actix-web-codegen) [![Documentation](https://docs.rs/actix-web-codegen/badge.svg)](https://docs.rs/actix-web-codegen/0.4.0/actix_web_codegen/) -[![Version](https://img.shields.io/badge/rustc-1.42+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.42.html) +[![Version](https://img.shields.io/badge/rustc-1.46+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html) [![Build Status](https://travis-ci.org/actix/actix-web.svg?branch=master)](https://travis-ci.org/actix/actix-web) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -14,7 +14,7 @@ - [API Documentation](https://docs.rs/actix-web-codegen) - [Chat on Gitter](https://gitter.im/actix/actix-web) - Cargo package: [actix-web-codegen](https://crates.io/crates/actix-web-codegen) -- Minimum supported Rust version: 1.42 or later. +- Minimum supported Rust version: 1.46 or later. ## Compile Testing Uses the [`trybuild`] crate. All compile fail tests should include a stderr file generated by `trybuild`. See the [workflow section](https://github.com/dtolnay/trybuild#workflow) of the trybuild docs for info on how to do this. diff --git a/actix-web-codegen/tests/trybuild.rs b/actix-web-codegen/tests/trybuild.rs index 6c7c58986..d2d8a38f5 100644 --- a/actix-web-codegen/tests/trybuild.rs +++ b/actix-web-codegen/tests/trybuild.rs @@ -6,31 +6,15 @@ fn compile_macros() { t.compile_fail("tests/trybuild/simple-fail.rs"); t.pass("tests/trybuild/route-ok.rs"); - - test_route_duplicate_unexpected_method(&t); - test_route_missing_method(&t) -} - -#[rustversion::stable(1.42)] -fn test_route_missing_method(t: &trybuild::TestCases) { - t.compile_fail("tests/trybuild/route-missing-method-fail-msrv.rs"); -} - -#[rustversion::not(stable(1.42))] -#[rustversion::not(nightly)] -fn test_route_missing_method(t: &trybuild::TestCases) { t.compile_fail("tests/trybuild/route-missing-method-fail.rs"); -} - -#[rustversion::nightly] -fn test_route_missing_method(_t: &trybuild::TestCases) {} - -// FIXME: Re-test them on nightly once rust-lang/rust#77993 is fixed. -#[rustversion::not(nightly)] -fn test_route_duplicate_unexpected_method(t: &trybuild::TestCases) { t.compile_fail("tests/trybuild/route-duplicate-method-fail.rs"); t.compile_fail("tests/trybuild/route-unexpected-method-fail.rs"); } -#[rustversion::nightly] -fn test_route_duplicate_unexpected_method(_t: &trybuild::TestCases) {} +// #[rustversion::not(nightly)] +// fn skip_on_nightly(t: &trybuild::TestCases) { +// +// } + +// #[rustversion::nightly] +// fn skip_on_nightly(_t: &trybuild::TestCases) {} diff --git a/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.rs b/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.rs deleted file mode 120000 index 70a5c0e33..000000000 --- a/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.rs +++ /dev/null @@ -1 +0,0 @@ -route-missing-method-fail.rs \ No newline at end of file diff --git a/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.stderr b/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.stderr deleted file mode 100644 index d3e2b60ae..000000000 --- a/actix-web-codegen/tests/trybuild/route-missing-method-fail-msrv.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: The #[route(..)] macro requires at least one `method` attribute - --> $DIR/route-missing-method-fail-msrv.rs:3:1 - | -3 | #[route("/")] - | ^^^^^^^^^^^^^ - -error[E0425]: cannot find value `index` in this scope - --> $DIR/route-missing-method-fail-msrv.rs:12:49 - | -12 | let srv = test::start(|| App::new().service(index)); - | ^^^^^ not found in this scope diff --git a/awc/README.md b/awc/README.md index b97d4fa00..972a80140 100644 --- a/awc/README.md +++ b/awc/README.md @@ -13,7 +13,7 @@ - [API Documentation](https://docs.rs/awc) - [Example Project](https://github.com/actix/examples/tree/HEAD/awc_https) - [Chat on Gitter](https://gitter.im/actix/actix-web) -- Minimum Supported Rust Version (MSRV): 1.42.0 +- Minimum Supported Rust Version (MSRV): 1.46.0 ## Example ```rust diff --git a/src/lib.rs b/src/lib.rs index 8246c8286..88eae44bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ //! * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/)) //! * Includes an async [HTTP client](https://actix.rs/actix-web/actix_web/client/index.html) //! * Supports [Actix actor framework](https://github.com/actix/actix) -//! * Runs on stable Rust 1.42+ +//! * Runs on stable Rust 1.46+ //! //! ## Crate Features //! @@ -65,7 +65,7 @@ //! * `rustls` - HTTPS support via `rustls` crate, supports `HTTP/2` //! * `secure-cookies` - secure cookies support -#![deny(rust_2018_idioms)] +#![deny(rust_2018_idioms, nonstandard_style)] #![allow(clippy::needless_doctest_main, clippy::type_complexity)] #![doc(html_logo_url = "https://actix.rs/img/logo.png")] #![doc(html_favicon_url = "https://actix.rs/favicon.ico")] From 20b46cdaf907aeb7253b63458307b564209d6210 Mon Sep 17 00:00:00 2001 From: Ibraheem Ahmed Date: Mon, 28 Dec 2020 16:04:02 -0500 Subject: [PATCH 5/6] format factory_tuple macro invocations (#1859) --- src/handler.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index b928939a5..d4b755e57 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -201,14 +201,14 @@ macro_rules! factory_tuple ({ $(($n:tt, $T:ident)),+} => { mod m { use super::*; -factory_tuple!((0, A)); -factory_tuple!((0, A), (1, B)); -factory_tuple!((0, A), (1, B), (2, C)); -factory_tuple!((0, A), (1, B), (2, C), (3, D)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I)); -factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I), (9, J)); + factory_tuple!((0, A)); + factory_tuple!((0, A), (1, B)); + factory_tuple!((0, A), (1, B), (2, C)); + factory_tuple!((0, A), (1, B), (2, C), (3, D)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I)); + factory_tuple!((0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I), (9, J)); } From 102bb8f9abf9fdc61d0c63b3ab183bd4e186ef47 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 29 Dec 2020 00:22:13 +0000 Subject: [PATCH 6/6] update dot dep graphs --- docs/graphs/net-only.dot | 6 +----- docs/graphs/web-focus.dot | 42 +++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/docs/graphs/net-only.dot b/docs/graphs/net-only.dot index 0eebf2a6f..9488f3fe7 100644 --- a/docs/graphs/net-only.dot +++ b/docs/graphs/net-only.dot @@ -2,12 +2,10 @@ digraph { subgraph cluster_net { label="actix/actix-net"; "actix-codec" - "actix-connect" "actix-macros" "actix-rt" "actix-server" "actix-service" - "actix-testing" "actix-threadpool" "actix-tls" "actix-tracing" @@ -17,9 +15,7 @@ digraph { "actix-utils" -> { "actix-service" "actix-rt" "actix-codec" } "actix-tracing" -> { "actix-service" } - "actix-tls" -> { "actix-service" "actix-codec" "actix-utils" } - "actix-testing" -> { "actix-rt" "actix-macros" "actix-server" "actix-service" } + "actix-tls" -> { "actix-service" "actix-codec" "actix-utils" "actix-rt" } "actix-server" -> { "actix-service" "actix-rt" "actix-codec" "actix-utils" } "actix-rt" -> { "actix-macros" "actix-threadpool" } - "actix-connect" -> { "actix-service" "actix-codec" "actix-utils" "actix-rt" } } diff --git a/docs/graphs/web-focus.dot b/docs/graphs/web-focus.dot index 17228fe62..55a82bb41 100644 --- a/docs/graphs/web-focus.dot +++ b/docs/graphs/web-focus.dot @@ -2,31 +2,29 @@ digraph { subgraph cluster_web { label="actix/actix-web" "awc" - "web" - "files" - "http" - "multipart" - "web-actors" - "codegen" - "http-test" + "actix-web" + "actix-files" + "actix-http" + "actix-multipart" + "actix-web-actors" + "actix-web-codegen" + "actix-http-test" } - "web" -> { "codec" "service" "utils" "router" "rt" "server" "testing" "macros" "threadpool" "tls" "codegen" "http" "awc" } - "awc" -> { "codec" "service" "http" "rt" } - "web-actors" -> { "actix" "web" "http" "codec" } - "multipart" -> { "web" "service" "utils" } - "http" -> { "service" "codec" "connect" "utils" "rt" "threadpool" } - "http" -> { "actix" "tls" }[color=blue] // optional - "files" -> { "web" } - "http-test" -> { "service" "codec" "connect" "utils" "rt" "server" "testing" "awc" } + "actix-web" -> { "actix-codec" "actix-service" "actix-utils" "actix-router" "actix-rt" "actix-server" "macros" "threadpool" "actix-tls" "actix-web-codegen" "actix-http" "awc" } + "awc" -> { "actix-codec" "actix-service" "actix-http" "actix-rt" } + "actix-web-actors" -> { "actix" "actix-web" "actix-http" "actix-codec" } + "actix-multipart" -> { "actix-web" "actix-service" "actix-utils" } + "actix-http" -> { "actix-service" "actix-codec" "actix-tls" "actix-utils" "actix-rt" "threadpool" } + "actix-http" -> { "actix" "actix-tls" }[color=blue] // optional + "actix-files" -> { "actix-web" } + "actix-http-test" -> { "actix-service" "actix-codec" "actix-tls" "actix-utils" "actix-rt" "actix-server" "awc" } // net - "utils" -> { "service" "rt" "codec" } - "tracing" -> { "service" } - "tls" -> { "service" "codec" "utils" } - "testing" -> { "rt" "macros" "server" "service" } - "server" -> { "service" "rt" "codec" "utils" } - "rt" -> { "macros" "threadpool" } - "connect" -> { "service" "codec" "utils" "rt" } + "actix-utils" -> { "actix-service" "actix-rt" "actix-codec" } + "actix-tracing" -> { "actix-service" } + "actix-tls" -> { "actix-service" "actix-codec" "actix-utils" } + "actix-server" -> { "actix-service" "actix-rt" "actix-codec" "actix-utils" } + "actix-rt" -> { "macros" "threadpool" } }