newtype-tools-derive 0.1.0-beta.7

A lightweight library designed to make the newtype idiom more ergonomic to use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[test]
fn attr_type_display_roundtrip() {
    use super::AttrType;
    assert_eq!(format!("{}", AttrType::From), "from");
    assert_eq!(format!("{}", AttrType::TryFrom), "try_from");
    assert_eq!(format!("{}", AttrType::Into), "into");
    assert_eq!(format!("{}", AttrType::TryInto), "try_into");
    assert_eq!(format!("{}", AttrType::Add), "add");
    assert_eq!(format!("{}", AttrType::AddAssign), "add_assign");
    assert_eq!(format!("{}", AttrType::PartialEq), "partial_eq");
    assert_eq!(format!("{}", AttrType::Sub), "sub");
    assert_eq!(format!("{}", AttrType::SubAssign), "sub_assign");
}