Assorted utilities
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
pantonshire 8309e19a68 strings: remove wide pointer cast in CappedString impl
`CappedString::as_bytes` previously used a wide pointer cast to obtain a
`&[u8]` from the `[MaybeUninit<u8>; N]` buffer; it cast a `*const
[MaybeUninit<u8>]` to a `*const [u8]` as an intermediate step. Although
this seems to be valid and did not cause any UB detected by MIRI, it
seems to be generally accepted that `slice::from_raw_parts` is the
preferred way to transmute slices since it makes explicit the metadata
(length in this case) of the new wide pointer. This is in contrast to
casting with `as`, which implicitly copies the metadata from the old
wide pointer into the new one.

Therefore, this patch replaces the `as *const [u8]` conversion with a
call to `slice::from_raw_parts`.
3 years ago
src strings: remove wide pointer cast in CappedString impl 3 years ago
.gitignore Initial commit 4 years ago
Cargo.toml RFC 3986 percent encoding, std feature now depends on alloc feature 3 years ago
README.md Create README.md 4 years ago
test.sh test: improve test script to allow easily adding new runs 3 years ago

README.md

libshire

A collection of assorted Rust utilities for reuse between various projects 🦀