Skip to content

Commit

Permalink
fix: remove unreleased Upgrade::request_headers and Upgrade::request_…
Browse files Browse the repository at this point in the history
…headers_mut
  • Loading branch information
jbr committed Apr 7, 2024
1 parent d90a9ee commit a108c8b
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions http/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,11 @@ pub struct Upgrade<Transport> {

impl<Transport> Upgrade<Transport> {
/// see [`request_headers`]
#[deprecated = "use Upgrade::request_headers"]
#[deprecated = "directly access the request_headers field"]
pub fn headers(&self) -> &Headers {
&self.request_headers
}

/// read-only access to the request headers
pub fn request_headers(&self) -> &Headers {
&self.request_headers
}

/// mutable access to headers
pub fn request_headers_mut(&mut self) -> &mut Headers {
&mut self.request_headers
}

/// the http request path up to but excluding any query component
pub fn path(&self) -> &str {
match self.path.split_once('?') {
Expand All @@ -70,10 +60,10 @@ impl<Transport> Upgrade<Transport> {

/// retrieves the query component of the path
pub fn querystring(&self) -> &str {
match self.path.split_once('?') {
Some((_, query)) => query,
None => "",
}
self.path
.split_once('?')
.map(|(_, query)| query)
.unwrap_or_default()
}

/// the http method
Expand Down

0 comments on commit a108c8b

Please sign in to comment.