rustgd / cgmath

A linear algebra and mathematics library for computer graphics.
https://docs.rs/cgmath
Apache License 2.0
1.12k stars 155 forks source link

Simplify "fold_array" macro #527

Closed Besler closed 3 years ago

Besler commented 3 years ago

Macro expand to an inverted composition:

Before

#[inline]
fn sum(self) -> S
where
    S: Add<Output = S>,
{
    self.x.add(self.y).add(self.z)
}

Now

#[inline]
fn sum(self) -> S
where
    S: Add<Output = S>,
{
    self.x.add(self.y.add(self.z))
}
bors[bot] commented 3 years ago

Configuration problem: bors.toml: not found