mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-18 20:54:29 -04:00
Export http::header::HeaderValue as http::HeaderValue (#222)
This commit is contained in:
committed by
Carl Lerche
parent
518b57ada5
commit
1cc157eaeb
@@ -5,7 +5,7 @@ extern crate http;
|
||||
extern crate test;
|
||||
|
||||
use bytes::Bytes;
|
||||
use http::header::HeaderValue;
|
||||
use http::HeaderValue;
|
||||
use test::Bencher;
|
||||
|
||||
static SHORT: &'static [u8] = b"localhost";
|
||||
|
||||
+5
-5
@@ -55,8 +55,8 @@
|
||||
//! to edit the request/response:
|
||||
//!
|
||||
//! ```
|
||||
//! use http::{Response, StatusCode};
|
||||
//! use http::header::{CONTENT_TYPE, HeaderValue};
|
||||
//! use http::{HeaderValue, Response, StatusCode};
|
||||
//! use http::header::CONTENT_TYPE;
|
||||
//!
|
||||
//! fn add_server_headers<T>(response: &mut Response<T>) {
|
||||
//! response.headers_mut()
|
||||
@@ -118,7 +118,7 @@
|
||||
//! function:
|
||||
//!
|
||||
//! ```
|
||||
//! use http::header::HeaderValue;
|
||||
//! use http::HeaderValue;
|
||||
//!
|
||||
//! let value = HeaderValue::from_static("text/html");
|
||||
//! assert_eq!(value.as_bytes(), b"text/html");
|
||||
@@ -127,7 +127,7 @@
|
||||
//! And header values can also be parsed like names:
|
||||
//!
|
||||
//! ```
|
||||
//! use http::header::HeaderValue;
|
||||
//! use http::HeaderValue;
|
||||
//!
|
||||
//! let value = "text/html";
|
||||
//! let value = value.parse::<HeaderValue>().unwrap();
|
||||
@@ -180,7 +180,7 @@ pub use convert::HttpTryFrom;
|
||||
pub use error::{Error, Result};
|
||||
pub use extensions::Extensions;
|
||||
#[doc(no_inline)]
|
||||
pub use header::HeaderMap;
|
||||
pub use header::{HeaderMap, HeaderValue};
|
||||
pub use method::Method;
|
||||
pub use request::Request;
|
||||
pub use response::Response;
|
||||
|
||||
Reference in New Issue
Block a user