1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 11:00:36 +02:00

Check code style with rustfmt on CI (#164)

This commit is contained in:
Yuki Okushi
2020-07-22 12:32:13 +09:00
committed by GitHub
parent 0dca1a705a
commit 8ace9264b7
13 changed files with 333 additions and 283 deletions

View File

@ -33,6 +33,13 @@ impl ByteString {
}
/// Creates a new `ByteString` from a Bytes.
///
/// # Safety
/// This function is unsafe because it does not check the bytes passed to it
/// are valid UTF-8. If this constraint is violated,
/// it may cause memory unsafety issues with future users of the `ByteString`,
/// as we assume that `ByteString`s are valid UTF-8.
/// However, the most likely issue is that the data gets corrupted.
pub const unsafe fn from_bytes_unchecked(src: Bytes) -> ByteString {
Self(src)
}