Rust: You Can Conditionally Enable Attributes

Rating: 6

Example

#[derive(Debug)]
#[cfg_attr(any(feature = "testing", feature = "dev"), derive(PartialEq))]
struct NodePtr(Rc<RefCell<RedBlackNode>>);
More Info