Maciejhirsz Beef Versions Save

Faster, more compact implementation of std::borrow::Cow

v0.5.2

1 year ago
  • Fix to pointer provenance for owned Cow<str> (#47), thanks to @Nilstrieb.

v0.5.1

2 years ago
  • The Deserialize implementation for beef::Cow<str> using the impl_serde feature is now specialized, and will produced a borrowed variant if possible, which is particularly useful for serde_json (see #44).
  • const_fn feature is internally using a narrower unstable feature gate const_fn_trait_bound (see #41).
  • Clarified documentation and doc tests to specify that beef::lean::Cow is two words wide on 64-bit architectures only.

v0.5.0

3 years ago
  • Fixed soundness issues around the Sync and Send markers (#37, #38. #39).
  • Added Unpin impl (#39).

v0.4.4

3 years ago
  • Implemented Default on Cow (#32).

v0.4.3

4 years ago
  • Added PartialOrd and Ord, and fixed Eq impls (#28, #29).

v.4.2

4 years ago
  • const_str and const_slice are now available for both beef::Cow and beef::lean::Cow.
  • const_str no longer requires nightly and is available without a feature flag.

v0.4.1

4 years ago
  • Added unwrap_borrowed method, thanks @Licenser (#20).

v0.4.0

4 years ago
  • Fixed a memory leak in beef::lean::Cow, found thanks to Miri and @RalfJung.
  • Added impl_serde feature which provides a Serialize and Deserialize trait implementations.
  • Added is_borrowed and is_owned methods.
  • beef::Cow<'a, T> is now a type alias to beef::generic::Cow<'a, T, Wide> where Wide is private. This doesn't change anything, merely hides Option<NonZeroUsize> as implementation detail and makes errors more readable.
  • Due to internal refactoring, const_fn feature now adds two separate functions instead of one: const_str and const_slice for borrowing &'static str and &'static [T] respectively. This is the only breaking change this release.

v0.3.0

4 years ago
  • beef::Cow<'a, T> is now a type alias for beef::generic::Cow<'a, T, Option<NonZeroUsize>>.
  • Added beef::lean::Cow<'a, T> which is a type alias for beef::generic::Cow<'a, T, Lean>, where Lean is a 0-sized struct. This version of the Cow stores length and capacity together on a single usize, and is only available for 64-bit targets.
  • Due to generic constraints const_fn now adds Cow::const_borrowed as a separate function. This is not available for beef::lean::Cow.
  • Beef trait has been made private.

v0.2.1

4 years ago
  • Reworked pointer casting in owned_from_parts.