diff --git a/deferred_division/src/ratio.rs b/deferred_division/src/ratio.rs index a6bd02d..6ae0ad2 100644 --- a/deferred_division/src/ratio.rs +++ b/deferred_division/src/ratio.rs @@ -3,8 +3,8 @@ pub struct Ratio{ pub(crate)num:Num, pub(crate)den:Den, } -//this trait is like a constructor for Ratio -pub trait DeferredDiv{ - type Output; - fn deferred_div(self,rhs:Rhs)->Self::Output; +impl Ratio{ + pub const fn new(num:Num,den:Den)->Self{ + Self{num,den} + } }