Remove unnecessary lifetime annotations. (#103)
This commit is contained in:
committed by
GitHub
parent
bbde617719
commit
e4ad3a5e5f
@@ -260,7 +260,7 @@ impl Request {
|
|||||||
/// .build();
|
/// .build();
|
||||||
/// assert_eq!("foobar", req.header("x-api-Key").unwrap());
|
/// assert_eq!("foobar", req.header("x-api-Key").unwrap());
|
||||||
/// ```
|
/// ```
|
||||||
pub fn header<'a>(&self, name: &'a str) -> Option<&str> {
|
pub fn header(&self, name: &str) -> Option<&str> {
|
||||||
header::get_header(&self.headers, name)
|
header::get_header(&self.headers, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ impl Request {
|
|||||||
/// .build();
|
/// .build();
|
||||||
/// assert_eq!(true, req.has("x-api-Key"));
|
/// assert_eq!(true, req.has("x-api-Key"));
|
||||||
/// ```
|
/// ```
|
||||||
pub fn has<'a>(&self, name: &'a str) -> bool {
|
pub fn has(&self, name: &str) -> bool {
|
||||||
header::has_header(&self.headers, name)
|
header::has_header(&self.headers, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ impl Request {
|
|||||||
/// "2.3.4.5",
|
/// "2.3.4.5",
|
||||||
/// ]);
|
/// ]);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn all<'a>(&self, name: &'a str) -> Vec<&str> {
|
pub fn all(&self, name: &str) -> Vec<&str> {
|
||||||
header::get_all_headers(&self.headers, name)
|
header::get_all_headers(&self.headers, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ impl Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The header corresponding header value for the give name, if any.
|
/// The header corresponding header value for the give name, if any.
|
||||||
pub fn header<'a>(&self, name: &'a str) -> Option<&str> {
|
pub fn header(&self, name: &str) -> Option<&str> {
|
||||||
self.headers
|
self.headers
|
||||||
.iter()
|
.iter()
|
||||||
.find(|h| h.is_name(name))
|
.find(|h| h.is_name(name))
|
||||||
@@ -139,12 +139,12 @@ impl Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tells if the response has the named header.
|
/// Tells if the response has the named header.
|
||||||
pub fn has<'a>(&self, name: &'a str) -> bool {
|
pub fn has(&self, name: &str) -> bool {
|
||||||
self.header(name).is_some()
|
self.header(name).is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// All headers corresponding values for the give name, or empty vector.
|
/// All headers corresponding values for the give name, or empty vector.
|
||||||
pub fn all<'a>(&self, name: &'a str) -> Vec<&str> {
|
pub fn all(&self, name: &str) -> Vec<&str> {
|
||||||
self.headers
|
self.headers
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|h| h.is_name(name))
|
.filter(|h| h.is_name(name))
|
||||||
|
|||||||
@@ -116,15 +116,15 @@ impl Unit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn header<'a>(&self, name: &'a str) -> Option<&str> {
|
pub fn header(&self, name: &str) -> Option<&str> {
|
||||||
header::get_header(&self.headers, name)
|
header::get_header(&self.headers, name)
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn has<'a>(&self, name: &'a str) -> bool {
|
pub fn has(&self, name: &str) -> bool {
|
||||||
header::has_header(&self.headers, name)
|
header::has_header(&self.headers, name)
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn all<'a>(&self, name: &'a str) -> Vec<&str> {
|
pub fn all(&self, name: &str) -> Vec<&str> {
|
||||||
header::get_all_headers(&self.headers, name)
|
header::get_all_headers(&self.headers, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ fn extract_cookies(_state: &std::sync::Mutex<Option<AgentState>>, _url: &Url) ->
|
|||||||
|
|
||||||
// TODO check so cookies can't be set for tld:s
|
// TODO check so cookies can't be set for tld:s
|
||||||
#[cfg(feature = "cookie")]
|
#[cfg(feature = "cookie")]
|
||||||
fn match_cookies<'a>(jar: &'a CookieJar, domain: &str, path: &str, is_secure: bool) -> Vec<Header> {
|
fn match_cookies(jar: &CookieJar, domain: &str, path: &str, is_secure: bool) -> Vec<Header> {
|
||||||
jar.iter()
|
jar.iter()
|
||||||
.filter(|c| {
|
.filter(|c| {
|
||||||
// if there is a domain, it must be matched.
|
// if there is a domain, it must be matched.
|
||||||
|
|||||||
Reference in New Issue
Block a user