Day 27 & Day 28

August 8, 2017 19:05 UTC Team Serv0101 (Servo) [2017]Subscribe to this teams's activities

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 "!="

Comments

You must be logged in to add a comment.