1
- //! Client header advertising which media types the client is able to understand
1
+ //! Client header advertising which media types the client is able to understand.
2
2
3
3
use crate :: content:: { ContentType , MediaTypeProposal } ;
4
4
use crate :: headers:: { HeaderName , HeaderValue , Headers , ToHeaderValues , ACCEPT } ;
@@ -9,15 +9,15 @@ use std::fmt::{self, Debug, Write};
9
9
use std:: option;
10
10
use std:: slice;
11
11
12
- /// Client header advertising which media types the client is able to understand
12
+ /// Client header advertising which media types the client is able to understand.
13
13
///
14
14
/// Using content negotiation, the server then selects one of the proposals, uses
15
15
/// it and informs the client of its choice with the `Content-Type` response
16
16
/// header. Browsers set adequate values for this header depending on the context
17
17
/// where the request is done: when fetching a CSS stylesheet a different value
18
18
/// is set for the request than when fetching an image, video or a script.
19
19
///
20
- /// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding )
20
+ /// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept)
21
21
///
22
22
/// # Specifications
23
23
///
@@ -34,7 +34,7 @@ use std::slice;
34
34
/// let mut accept = Accept::new();
35
35
/// accept.push(MediaTypeProposal::new(mime::HTML, Some(0.8))?);
36
36
/// accept.push(MediaTypeProposal::new(mime::XML, Some(0.4))?);
37
- /// accept.push(MediaTypeProposal::new( mime::PLAIN, None)? );
37
+ /// accept.push(mime::PLAIN);
38
38
///
39
39
/// let mut res = Response::new(200);
40
40
/// let content_type = accept.negotiate(&[mime::XML])?;
0 commit comments