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

Don't export Header struct #682

Merged
merged 1 commit into from
Dec 9, 2023
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
3 changes: 2 additions & 1 deletion src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#[derive(Clone, PartialEq, Eq)]
/// Wrapper type for a header field.
/// <https://tools.ietf.org/html/rfc7230#section-3.2>
pub struct Header {
pub(crate) struct Header {
// Line contains the unmodified bytes of single header field.
// It does not contain the final CRLF.
line: HeaderLine,
Expand Down Expand Up @@ -115,7 +115,8 @@
///
/// 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"))]
pub fn value_raw(&self) -> &[u8] {

Check failure on line 119 in src/header.rs

View workflow job for this annotation

GitHub Actions / Test (charset)

method `value_raw` is never used

Check failure on line 119 in src/header.rs

View workflow job for this annotation

GitHub Actions / Test (charset)

method `value_raw` is never used
let mut bytes = &self.line.as_bytes()[self.index + 1..];

if !bytes.is_empty() {
Expand Down
4 changes: 2 additions & 2 deletions src/http_interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ 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
/// placeholder. Additionally, if the response has a header which cannot be converted into
/// the ureq equivalent, 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.
///
/// ```
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ pub use crate::agent::Agent;
pub use crate::agent::AgentBuilder;
pub use crate::agent::RedirectAuthHeaders;
pub use crate::error::{Error, ErrorKind, OrAnyStatus, Transport};
pub use crate::header::Header;
pub use crate::middleware::{Middleware, MiddlewareNext};
pub use crate::proxy::Proxy;
pub use crate::request::{Request, RequestUrl};
Expand Down
Loading