dairy 0.1.0

A more compact, user friendly implementation of `Cow`.
Documentation

dairy

A more compact, user friendly implementation of Cow.

  • Optimized for use on 64-bit Unix systems (behind unix feature).
  • Much better support for Cow<Path> and Cow<OsStr>.
use std::path::Path;
use dairy::Cow;

let name: Cow<str> = "Hello World!".into();
let path: Cow<Path> = "./path/to/file.txt".into();

Caveats

  • Only str, OsStr, CStr and Path types are supported.
  • OsStr, CStr and Path are only supported on Unix.
  • On 32-bit operating systems the maximum length of types is (2¹⁶ - 1).

Acknowledgements

Some implementation details taken from the excellent beef crate.

License

Licensed under either of

at your option.