extend

Crates.ioextend
lib.rsextend
version1.2.0
sourcesrc
created_at2019-10-30 23:03:22.812708
updated_at2023-03-18 20:13:19.230021
descriptionCreate extensions for types you don't own with extension traits but without the boilerplate.
homepagehttps://github.com/davidpdrsn/extend
repositoryhttps://github.com/davidpdrsn/extend
max_upload_size
id177061
size33,691
David Pedersen (davidpdrsn)

documentation

README

extend

Crates.io Docs dependency status Build status maintenance-status

Create extensions for types you don't own with extension traits but without the boilerplate.

Example:

use extend::ext;

#[ext]
impl<T: Ord> Vec<T> {
    fn sorted(mut self) -> Self {
        self.sort();
        self
    }
}

fn main() {
    assert_eq!(
        vec![1, 2, 3],
        vec![2, 3, 1].sorted(),
    );
}
Commit count: 60

cargo fmt