remove internal DataFactory trait

This commit is contained in:
Rob Ede 2020-12-27 16:44:08 +00:00
parent 9f02fe1f28
commit 3f49a5ce8f
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
2 changed files with 7 additions and 14 deletions

View File

@ -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]

View File

@ -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<T>(pub(crate) T);
impl<T: Clone + 'static> DataFactory for Data<T> {
fn set(&self, ext: &mut Extensions) {
ext.insert(self.0.clone())
}
}
#[cfg(test)]
mod tests {
use std::str::from_utf8;