surrealpatch/src/net/input.rs
2023-07-19 14:35:56 +00:00

6 lines
168 B
Rust

use crate::err::Error;
use bytes::Bytes;
pub(crate) fn bytes_to_utf8(bytes: &Bytes) -> Result<&str, Error> {
std::str::from_utf8(bytes).map_err(|_| Error::Request)
}