twilight-rs / twilight

Powerful, flexible, and scalable ecosystem of Rust libraries for the Discord API.
https://discord.gg/twilight-rs
ISC License
656 stars 130 forks source link

refactor(http)!: avoid copying the reponse body on utf8 error #2299

Closed nickelc closed 9 months ago

nickelc commented 9 months ago

The TextFuture now returns std::str::Utf8Error as source error if the body is not a valid UTF-8 string.

There is no need to provide the bytes with the error kind variant and as part of the source error.