File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -486,29 +486,14 @@ impl Body {
486486 /// use http_types::mime;
487487 ///
488488 /// let mut body = Body::empty();
489- /// body.set_mime(mime::CSS);
489+ /// body.set_mime(Some( mime::CSS) );
490490 /// assert_eq!(body.mime(), Some(&mime::CSS));
491- /// ```
492- pub fn set_mime ( & mut self , mime : impl Into < Mime > ) {
493- self . mime = Some ( mime. into ( ) ) ;
494- }
495-
496- /// Unsets the mime type of this Body.
497491 ///
498- /// # Examples
492+ /// body.set_mime(None);
493+ /// assert_eq!(body.mime(), None);
499494 /// ```
500- /// use http_types::Body;
501- /// use http_types::mime;
502- ///
503- /// let mut body = Body::empty();
504- /// assert!(body.mime().is_some());
505- ///
506- /// body.unset_mime();
507- /// assert!(body.mime().is_none());
508- /// ```
509- ///
510- pub fn unset_mime ( & mut self ) {
511- self . mime = None
495+ pub fn set_mime ( & mut self , mime : Option < Mime > ) {
496+ self . mime = mime;
512497 }
513498
514499 /// Create a Body by chaining another Body after this one, consuming both.
You can’t perform that action at this time.
0 commit comments