assert_ne! checks that two values are different. If they are equal, the program panics. The ne means “not equal,” making the macro useful for catching logic errors and testing assumptions. section 6.3
Checking an input
let my_name = "Loki Laufeyson"; assert_ne!(my_name, "Mithridates"); This assertion succeeds because the two values differ. If my_name is "Mithridates", assert_ne! panics instead.
