#default #traits #go #along

no-std extra-default

Extra traits to go along with the Default trait

2 unstable releases

Uses old Rust 2015

0.2.0 Apr 15, 2017
0.1.0 Feb 21, 2017

#12 in #along

Download history 5/week @ 2024-02-19 17/week @ 2024-02-26 1/week @ 2024-03-04 3/week @ 2024-03-11 4/week @ 2024-03-25 45/week @ 2024-04-01

53 downloads per month
Used in 3 crates (via multistr)

Custom license

6KB
121 lines

Extra Default traits

Extra traits to go along with the Default trait. You may freely use and modify this code under the CC0 1.0 Universal License.

Usage

To use in your own project, just add the below to your Cargo.toml file.

[dependencies]
extra-default = "0.1"

For more formal documentation, you can find the rustdoc here.


lib.rs:

This crate provides additional Default traits which are most useful for slices and strings.

  • DefaultRef is imiplemented for for<'a> &'a Self: Default.
  • DefaultBox is imiplemented for Box<Self>: Default.
  • DefaultOwned is imiplemented for <Self as ToOwned>::Owned: Default.

No runtime deps

Features