pub fn new(size: IntervalSize, quality: IntervalQuality) -> Result<Interval, IntervalError> {
        use IntervalSize::*;
        use IntervalQuality::*;
        match quality {
            Major | Minor => match size {
                Unison | Fourth | Fifth => return Err(IntervalError::InvalidQualityAndSizeCombination),
                _ => {}
            },
            Perfect => match size {
                Second | Third | Sixth | Seventh => return Err(IntervalError::InvalidQualityAndSizeCombination),
                _ => {},
            },
            _ => {}
        };
        Ok(Interval { size, quality })
    }
/// Instantiate a new `Interval`. If an invalid combination is entered, such as a major fourth or a perfect third,
/// the function will return an error.
Instantiate a new `Interval`. If an invalid combination is entered, such as a major fourth or a perfect third,
the function will return an error.
Instantiate a new ` Interval ` . If an invalid combination is entered such as a major fourth or a perfect third the function will return an error .
pub fn new(size: IntervalSize, quality: IntervalQuality) -> Result<Interval, IntervalError> {
        use IntervalSize::*;
        use IntervalQuality::*;
        match quality {
            Major | Minor => match size {
                Unison | Fourth | Fifth => return Err(IntervalError::InvalidQualityAndSizeCombination),
                _ => {}
            },
            Perfect => match size {
                Second | Third | Sixth | Seventh => return Err(IntervalError::InvalidQualityAndSizeCombination),
                _ => {},
            },
            _ => {}
        };
        Ok(Interval { size, quality })
    }
pub fn new ( size : IntervalSize , quality : IntervalQuality ) -> Result < Interval , IntervalError > { use IntervalSize :: * ; use IntervalQuality :: * ; match quality { Major | Minor => match size { Unison | Fourth | Fifth => return Err ( IntervalError :: InvalidQualityAndSizeCombination ) , _ => { } } , Perfect => match size { Second | Third | Sixth | Seventh => return Err ( IntervalError :: InvalidQualityAndSizeCombination ) , _ => { } , } , _ => { } } ; Ok ( Interval { size , quality } ) }
Instantiate a new `Interval`.
Instantiate a new ` Interval ` .
size
IntervalSize
quality
IntervalQuality