Convert the body into a [`String`], erroring if it is not valid UTF-8.
(self)
| 699 | |
| 700 | /// Convert the body into a [`String`], erroring if it is not valid UTF-8. |
| 701 | pub fn into_string(self) -> Result<String, std::string::FromUtf8Error> { |
| 702 | String::from_utf8(self.into_bytes().into()) |
| 703 | } |
| 704 | |
| 705 | /// Convert the body into a [`String`], replacing invalid UTF-8 with |
| 706 | /// `U+FFFD REPLACEMENT CHARACTER`, which looks like this: �. |
no test coverage detected