We have explored the concepts of generics and parameterization. Let's scan through the project to see if any concepts would be appropriate to use.
Applying parameterization concepts
Parameterizing data
Parametric data allows us to declare only the minimal amount of semantic information required. Instead of specifying a type, we can specify a generic parameter having a trait. Let's start by looking at physics.rs type declarations:
#[derive(Clone,Serialize,Deserialize,Debug)]
pub enum MotorInput
{
Up { voltage: f64 },
Down { voltage: f64 }
}
#[derive(Clone,Serialize,Deserialize,Debug)]
pub struct ElevatorSpecification
{
pub floor_count: u64,
pub floor_height: f64,
pub carriage_weight: f64
}
#[derive(Clone,Serialize...