mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-05 20:55:05 +00:00
b5b01f4dd7
It helps to implement transparent conversion from &str to &Wrapped(str). We could instead wrap the reference as Wrapped<'a>(&'a str), but it has various drawbacks. Notably we can't implement Borrow and Deref because these traits require a reference in return position. Since the unsafe bits are pretty small, we can instead implement cast functions without using the ref-cast crate. However, I believe we'll trust ref-cast more than hand-crafted unsafe code. https://crates.io/crates/ref-cast https://docs.rs/ref-cast/1.0.20/ref_cast/attr.ref_cast_custom.html |
||
---|---|---|
.. | ||
benches | ||
gen-protos | ||
src | ||
tests | ||
testutils | ||
Cargo.toml | ||
LICENSE |