mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-15 03:38:56 -05:00
13 lines
323 B
Rust
13 lines
323 B
Rust
|
|
use crate::Result;
|
||
|
|
|
||
|
|
/// Parses the bytes into a string.
|
||
|
|
#[inline]
|
||
|
|
pub fn string_from_bytes(bytes: &[u8]) -> Result<String> {
|
||
|
|
let str: &str = str_from_bytes(bytes)?;
|
||
|
|
Ok(str.to_owned())
|
||
|
|
}
|
||
|
|
|
||
|
|
/// Parses the bytes into a string.
|
||
|
|
#[inline]
|
||
|
|
pub fn str_from_bytes(bytes: &[u8]) -> Result<&str> { Ok(std::str::from_utf8(bytes)?) }
|