pub fn add_one(x:i32)->i32{
x+1
}
pub use self::kinds::PrimaryColor;
pub use self::kinds::SecondaryColor;
pub use self::utils::mix;
pub mod kinds{
#[derive(PartialEq)]
pub enum PrimaryColor{
Red,
Yellow,
Blue,
}
pub enum SecondaryColor{
Orange,
Green,
Purple,
}
}
pub mod utils{
use crate::kinds::*;
pub fn mix(c1:PrimaryColor,c2:PrimaryColor)->SecondaryColor{
if(c1==PrimaryColor::Red&&c2==PrimaryColor::Yellow)||(c2==PrimaryColor::Red&&c1==PrimaryColor::Yellow)
{SecondaryColor::Orange}
else if(c1==PrimaryColor::Red&&c2==PrimaryColor::Blue)||(c2==PrimaryColor::Red&&c1==PrimaryColor::Blue)
{SecondaryColor::Purple}
else if(c1==PrimaryColor::Yellow&&c2==PrimaryColor::Blue)||(c2==PrimaryColor::Yellow&&c1==PrimaryColor::Blue)
{SecondaryColor::Green}
else {panic!("Wrong match")}
}
}