mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-29 00:00:18 +02:00
Avoid reallocation for String body extraction (#2857)
This commit is contained in:
@@ -137,9 +137,7 @@ where
|
||||
}
|
||||
})?;
|
||||
|
||||
let string = std::str::from_utf8(&bytes)
|
||||
.map_err(InvalidUtf8::from_err)?
|
||||
.to_owned();
|
||||
let string = String::from_utf8(bytes.into()).map_err(InvalidUtf8::from_err)?;
|
||||
|
||||
Ok(string)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user