Day 27 & Day 28
So many learning is going on while writing test cases.
A new thing that we learned is:
PartialEq -> It is a trait for equality comparisons.
This trait can be used with #[derive]. When derived on structs, two instances are equal if all fields are equal, and not equal if any fields are not equal. When derived on enums, each variant is equal to itself and not equal to the other variants.
It has two methods :
1. fn eq(&self, other: &Rhs) -> bool
This method tests for "=="
2. fn ne(&self, other: &Rhs) -> bool
This method tests for "!="
You must be logged in to add a comment.