~jplatte/const-unit-poc

656cfc27fc9cd2fb0f0f1a129de28f8c88f44735 — Jonas Platte 2 months ago 2ab8974
Make SiUnit methods public

Required for compatibility with newer nightlies.
1 files changed, 3 insertions(+), 3 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +3 -3
@@ 63,7 63,7 @@ pub struct SiUnit {

// Can't call trait methods in const context, so these are inherent methods
impl SiUnit {
    const fn neg(self) -> Self {
    pub const fn neg(self) -> Self {
        Self {
            m: -self.m,
            kg: -self.kg,


@@ 75,7 75,7 @@ impl SiUnit {
        }
    }

    const fn unit_mul(self, rhs: Self) -> Self {
    pub const fn unit_mul(self, rhs: Self) -> Self {
        Self {
            m: self.m + rhs.m,
            kg: self.kg + rhs.kg,


@@ 87,7 87,7 @@ impl SiUnit {
        }
    }

    const fn unit_div(self, rhs: Self) -> Self {
    pub const fn unit_div(self, rhs: Self) -> Self {
        Self {
            m: self.m - rhs.m,
            kg: self.kg - rhs.kg,