Skip to content

Commit 1706e8b

Browse files
committed
Body::into_string returns crate::Result
1 parent c69b9ff commit 1706e8b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Body {
219219
/// assert_eq!(&body.into_string().await.unwrap(), "Hello Nori");
220220
/// # Ok(()) }) }
221221
/// ```
222-
pub async fn into_string(mut self) -> io::Result<String> {
222+
pub async fn into_string(mut self) -> crate::Result<String> {
223223
let mut result = String::with_capacity(self.len().unwrap_or(0));
224224
self.read_to_string(&mut result).await?;
225225
Ok(result)

src/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl Request {
304304
/// assert_eq!(&req.body_string().await.unwrap(), "Hello Nori");
305305
/// # Ok(()) }) }
306306
/// ```
307-
pub async fn body_string(self) -> io::Result<String> {
307+
pub async fn body_string(self) -> crate::Result<String> {
308308
self.body.into_string().await
309309
}
310310

src/response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl Response {
261261
/// assert_eq!(&res.body_string().await.unwrap(), "Hello Nori");
262262
/// # Ok(()) }) }
263263
/// ```
264-
pub async fn body_string(self) -> io::Result<String> {
264+
pub async fn body_string(self) -> crate::Result<String> {
265265
self.body.into_string().await
266266
}
267267

0 commit comments

Comments
 (0)