Use #[cfg(feature = "cookie")] for some functions.
Some helper functions introduced as part of the cookies_on_redirect test are only used by that test, which means they are only used when the cookie feature is enabled. This causes clippy warnings for some of the other feature combinations in CI.
This commit is contained in:
committed by
Martin Algesten
parent
b8b67a41a9
commit
c343587afb
@@ -100,6 +100,7 @@ fn connection_reuse() {
|
|||||||
assert_eq!(resp.status(), 200);
|
assert_eq!(resp.status(), 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "cookie")]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
fn cookie_and_redirect(mut stream: TcpStream) -> io::Result<()> {
|
fn cookie_and_redirect(mut stream: TcpStream) -> io::Result<()> {
|
||||||
let headers = read_headers(&stream);
|
let headers = read_headers(&stream);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ pub struct TestHeaders(Vec<String>);
|
|||||||
|
|
||||||
impl TestHeaders {
|
impl TestHeaders {
|
||||||
// Return the path for a request, e.g. /foo from "GET /foo HTTP/1.1"
|
// Return the path for a request, e.g. /foo from "GET /foo HTTP/1.1"
|
||||||
|
#[cfg(feature = "cookie")]
|
||||||
pub fn path(&self) -> &str {
|
pub fn path(&self) -> &str {
|
||||||
if self.0.len() == 0 {
|
if self.0.len() == 0 {
|
||||||
""
|
""
|
||||||
@@ -21,6 +22,7 @@ impl TestHeaders {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "cookie")]
|
||||||
pub fn headers(&self) -> &[String] {
|
pub fn headers(&self) -> &[String] {
|
||||||
&self.0[1..]
|
&self.0[1..]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user