@@ -270,20 +270,6 @@ impl_curve!(time::Time);
270270impl_curve ! ( time:: OffsetDateTime ) ;
271271impl_curve ! ( time:: PrimitiveDateTime ) ;
272272
273- // Implement the Curve for unsigned integer types.
274- // impl_curve!(u64);
275- // impl_curve!(u32);
276- // impl_curve!(u16);
277- // impl_curve!(u8);
278- // impl_curve!(usize);
279-
280- // Implement the Curve for signed integer types.
281- // impl_curve!(i64);
282- // impl_curve!(i32);
283- // impl_curve!(i16);
284- // impl_curve!(i8);
285- // impl_curve!(isize);
286-
287273// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288274// CURVE RELATED CONSTANTS
289275// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -296,7 +282,7 @@ const CURVE_OPTIM_SWARM_SIZE: usize = 1000;
296282// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297283
298284/// Generic trait for curves.
299- pub trait Curves < C > {
285+ pub trait Curves {
300286 /// Create a new curve from a set of `Date`s and rates (`f64`s).
301287 fn new ( dates : & [ Date ] , rates : & [ f64 ] ) -> Self ;
302288
@@ -324,10 +310,7 @@ pub trait Curves<C> {
324310
325311macro_rules! impl_specific_curve_cost_function {
326312 ( $curve: ident, $curve_function: ident) => {
327- impl <C > CostFunction for & $curve<Date , C >
328- where
329- C : Calendar ,
330- {
313+ impl CostFunction for & $curve<Date > {
331314 type Param = Vec <f64 >;
332315 type Output = f64 ;
333316
@@ -359,9 +342,7 @@ macro_rules! impl_specific_curve_cost_function {
359342
360343macro_rules! impl_specific_curve {
361344 ( $curve: ident, $curve_function: ident) => {
362- impl <C > Curves <C > for $curve<Date , C >
363- where
364- C : Calendar + Clone ,
345+ impl Curves for $curve<Date >
365346 {
366347 #[ doc = concat!( "Fit the " , stringify!( $curve) ) ]
367348 fn fit( & mut self ) -> Result <( ) , argmin:: core:: Error > {
@@ -529,16 +510,15 @@ macro_rules! impl_specific_curve {
529510
530511/// Discount curve data structure.
531512#[ derive( Builder , Clone , Debug ) ]
532- pub struct DiscountCurve < I , C >
513+ pub struct DiscountCurve < I >
533514where
534515 I : CurveIndex ,
535- C : Calendar ,
536516{
537517 /// Map of dates and rates.
538518 pub curve : Curve < I > ,
539519
540520 /// Calendar.
541- pub calendar : Option < C > ,
521+ pub calendar : Option < Calendar > ,
542522
543523 /// Day count convention.
544524 pub day_count_convention : Option < DayCountConvention > ,
@@ -569,16 +549,15 @@ impl_specific_curve!(DiscountCurve, discount_factor);
569549
570550/// Spot curve data structure.
571551#[ derive( Builder , Clone , Debug ) ]
572- pub struct SpotCurve < I , C >
552+ pub struct SpotCurve < I >
573553where
574554 I : CurveIndex ,
575- C : Calendar ,
576555{
577556 /// Map of dates and rates.
578557 pub curve : Curve < I > ,
579558
580559 /// Calendar.
581- pub calendar : Option < C > ,
560+ pub calendar : Option < Calendar > ,
582561
583562 /// Day count convention.
584563 pub day_count_convention : Option < DayCountConvention > ,
@@ -609,16 +588,15 @@ impl_specific_curve!(SpotCurve, spot_rate);
609588
610589/// Forward curve data structure.
611590#[ derive( Builder , Clone , Debug ) ]
612- pub struct ForwardCurve < I , C >
591+ pub struct ForwardCurve < I >
613592where
614593 I : CurveIndex ,
615- C : Calendar ,
616594{
617595 /// Map of dates and rates.
618596 pub curve : Curve < I > ,
619597
620598 /// Calendar.
621- pub calendar : Option < C > ,
599+ pub calendar : Option < Calendar > ,
622600
623601 /// Day count convention.
624602 pub day_count_convention : Option < DayCountConvention > ,
@@ -649,15 +627,12 @@ impl_specific_curve!(ForwardCurve, forward_rate);
649627
650628/// Flat curve data structure.
651629#[ derive( Builder , Clone , Debug ) ]
652- pub struct FlatCurve < C >
653- where
654- C : Calendar ,
655- {
630+ pub struct FlatCurve {
656631 /// Rate of the curve.
657632 pub rate : f64 ,
658633
659634 /// Calendar.
660- pub calendar : Option < C > ,
635+ pub calendar : Option < Calendar > ,
661636
662637 /// Day count convention.
663638 pub day_count_convention : Option < DayCountConvention > ,
@@ -666,10 +641,7 @@ where
666641 pub date_rolling_convention : Option < DateRollingConvention > ,
667642}
668643
669- impl < C > FlatCurve < C >
670- where
671- C : Calendar ,
672- {
644+ impl FlatCurve {
673645 /// Create a new flat curve.
674646 pub fn new_flat_curve ( rate : f64 ) -> Self {
675647 Self {
0 commit comments