clean-up: get rid of misplaced cfg(test)
Signed-off-by: Popa <dpopa@amazon.com> Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
@@ -179,15 +179,6 @@ impl Headers {
|
||||
self.expect
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn new(content_length: i32, expect: bool, chunked: bool) -> Self {
|
||||
Self {
|
||||
content_length,
|
||||
expect,
|
||||
chunked,
|
||||
}
|
||||
}
|
||||
|
||||
/// Parses a byte slice into a Headers structure for a HTTP request.
|
||||
///
|
||||
/// The byte slice is expected to have the following format: </br>
|
||||
@@ -299,6 +290,16 @@ impl MediaType {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
impl Headers {
|
||||
pub fn new(content_length: i32, expect: bool, chunked: bool) -> Self {
|
||||
Self {
|
||||
content_length,
|
||||
expect,
|
||||
chunked,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_default() {
|
||||
let headers = Headers::default();
|
||||
|
||||
@@ -129,15 +129,6 @@ impl RequestLine {
|
||||
fn min_len() -> usize {
|
||||
Method::Get.raw().len() + 1 + Version::Http10.raw().len() + 2
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn new(method: Method, uri: &str, http_version: Version) -> Self {
|
||||
Self {
|
||||
method,
|
||||
uri: Uri::new(uri),
|
||||
http_version,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper over an HTTP Request.
|
||||
@@ -274,6 +265,16 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
impl RequestLine {
|
||||
pub fn new(method: Method, uri: &str, http_version: Version) -> Self {
|
||||
Self {
|
||||
method,
|
||||
uri: Uri::new(uri),
|
||||
http_version,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_uri() {
|
||||
for tc in &vec![
|
||||
|
||||
Reference in New Issue
Block a user