ops-derive

Crates.ioops-derive
lib.rsops-derive
version0.1.1
sourcesrc
created_at2021-03-06 01:25:36.923794
updated_at2021-03-06 05:23:22.735931
descriptionDerive macros for std::ops
homepage
repository
max_upload_size
id364615
size9,126
John Bretz (bretzle)

documentation

README

OpsDerive

Derive macros for std::ops

Examples

use ops_derive::*;

#[derive(Debug, PartialEq, AutoAdd)]
pub struct Point {
    x: u32,
    y: u32,
    z: u32,
}

impl Point {
	pub fn new(x: u32, y: u32, z: u32) -> Self {
		Self { x, y, z }
	}
}

fn main() {
	let a = Point::new(1, 2, 3);
	let b = Point::new(4, 5, 6);
	let c = Point::new(5, 7, 9);

	assert_eq!(a + b, c);
}
Commit count: 0

cargo fmt