beef
beef copied to clipboard
Faster, more compact implementation of std::borrow::Cow
`const_deref` feature should add almost all `const` functionality from `std::borrow::Cow` Sorry for the code duplication
```rust //use beef::lean::Cow; -- compile error use std::borrow::Cow; struct Data>, } fn main() { let mut data = Data { data: "hello".into(), follower: None, }; data.follower = Cow::from(&data.data).into(); } ```...
If i use the following code with `std::Cow` - will be ok ```rust let string = "hello".to_string(); let cow: Cow = Cow::from(&string); ``` but `beef::Cow` tells me: ``` error[E0277]: the...
In the case of `Beef::borrowed` can be implemented `const Deref`. Will it be done?
One test fails when building on i686 or armv7hl ``` ---- src/lib.rs - (line 26) stdout ---- Test executable failed (exit code 101). stderr: thread 'main' panicked at 'assertion failed:...
This should remove the restriction on `beef::lean::Cow` being only available on targets with a pointer width of 64
&() is the same as usize, which is pointer size, it also looks shorter
As far as I can see, I'm not able to put own/std types into a beefcow except those that are explicitly enabled in this library. So would it be possible...
Messing around between the fat pointer and thin pointer is quite a lot of work, and there is quite some deep coupling between `generic::Cow`, the `Beef` trait and the `Capacity`....