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 some compilation problems due to Header #696

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/chunked/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![allow(dead_code)]
#![allow(dead_code, unused_imports)]
mod decoder;
pub use decoder::Decoder;

Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Display for Error {
match self {
Error::Status(status, response) => {
write!(f, "{}: status code {}", response.get_url(), status)?;
if let Some(original) = response.history.get(0) {
if let Some(original) = response.history.first() {
write!(f, " (redirected from {})", original)?;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl Header {
///
/// ureq can't know what encoding the header is in, but this function provides
/// an escape hatch for users that need to handle such headers.
#[cfg(any(feature = "http-interop", feature = "charset"))]
#[allow(unused)]
pub fn value_raw(&self) -> &[u8] {
let mut bytes = &self.line.as_bytes()[self.index + 1..];

Expand Down Expand Up @@ -159,7 +159,7 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> {
.and_then(|h| h.value())
}

#[cfg(any(doc, all(test, any(feature = "http-interop", feature = "http-crate"))))]
#[allow(unused)]
pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> {
headers
.iter()
Expand Down
6 changes: 3 additions & 3 deletions src/http_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use crate::{header::HeaderLine, response::ResponseStatusIndex, Request, Response
/// Converts an [`http::Response`] into a [`Response`].
///
/// As an [`http::Response`] does not contain a URL, `"https://example.com/"` is used as a
/// placeholder. Additionally, if the response has a header which cannot be converted into a valid
/// [`Header`](crate::Header), it will be skipped rather than having the conversion fail. The remote
/// address property will also always be `127.0.0.1:80` for similar reasons to the URL.
/// placeholder. Additionally, if the response has a header which cannot be converted to ureq's
/// internal header representation, it will be skipped rather than having the conversion fail.
/// The remote address property will also always be `127.0.0.1:80` for similar reasons to the URL.
///
/// ```
/// # fn main() -> Result<(), http::Error> {
Expand Down
Loading