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.
Previously, several functions in the implementation of `InliningString` converted raw pointers to references as part of large blocks of code, either via deref coercion or via `slice::from_raw_parts`. This created a risk of Rust inferring reference lifetimes that were too long; this is bad because it could result in a use-after-free or mutable aliasing. This patch moves pointer-to-reference conversions in `InliningString` to dedicated helper functions with explicit or easily-elided lifetimes to avoid this issue. This patch also introduces a `InliningString::take_boxed_buf_invalidating` method, which provides a way to move the boxed buffer out of an `InliningString` without aliasing the box's heap allocation (which is not allowed). The `Drop` implementation is reworked to use this method, as well as `InliningString::into_boxed_str`. |
3 years ago | |
|---|---|---|
| src | 3 years ago | |
| .gitignore | 4 years ago | |
| Cargo.toml | 3 years ago | |
| README.md | 4 years ago | |
| test.sh | 3 years ago | |
README.md
libshire
A collection of assorted Rust utilities for reuse between various projects 🦀