forked from mirrors/jj
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 |