Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove unreleased Upgrade::request_headers and Upgrade::request_… #627

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading