11//! Implementation of the equality assertions.
22
33use crate :: assertions:: {
4- AssertEquality , AssertHasDebugMessage , AssertHasDisplayMessage , AssertSameAs ,
4+ AssertEquality , AssertHasDebugMessage , AssertHasDisplayString , AssertSameAs ,
55} ;
66use crate :: colored:: { mark_diff, mark_diff_str} ;
77use crate :: expectations:: {
8- has_debug_message, has_display_message , is_equal_to, is_same_as, not, HasDebugMessage ,
9- HasDisplayMessage , IsEqualTo , IsSameAs ,
8+ has_debug_message, has_display_string , is_equal_to, is_same_as, not, HasDebugMessage ,
9+ HasDisplayString , IsEqualTo , IsSameAs ,
1010} ;
1111use crate :: spec:: { DiffFormat , Expectation , Expression , FailingStrategy , Invertible , Spec } ;
1212use crate :: std:: fmt:: { Debug , Display } ;
@@ -138,22 +138,22 @@ where
138138
139139impl < E > Invertible for HasDebugMessage < E > { }
140140
141- impl < S , E , R > AssertHasDisplayMessage < E > for Spec < ' _ , S , R >
141+ impl < S , E , R > AssertHasDisplayString < E > for Spec < ' _ , S , R >
142142where
143143 S : Display ,
144144 E : AsRef < str > ,
145145 R : FailingStrategy ,
146146{
147- fn has_display_message ( self , expected : E ) -> Self {
148- self . expecting ( has_display_message ( expected) )
147+ fn has_display_string ( self , expected : E ) -> Self {
148+ self . expecting ( has_display_string ( expected) )
149149 }
150150
151- fn does_not_have_display_message ( self , expected : E ) -> Self {
152- self . expecting ( not ( has_display_message ( expected) ) )
151+ fn does_not_have_display_string ( self , expected : E ) -> Self {
152+ self . expecting ( not ( has_display_string ( expected) ) )
153153 }
154154}
155155
156- impl < S , E > Expectation < S > for HasDisplayMessage < E >
156+ impl < S , E > Expectation < S > for HasDisplayString < E >
157157where
158158 S : Display ,
159159 E : AsRef < str > ,
@@ -173,9 +173,9 @@ where
173173 let expected = self . expected . as_ref ( ) ;
174174 let ( marked_actual, marked_expected) = mark_diff_str ( & actual. to_string ( ) , expected, format) ;
175175 format ! (
176- "expected {expression} to {not}have display message {expected:?}\n but was: \" {marked_actual}\" \n expected: {not}\" {marked_expected}\" " ,
176+ "expected {expression} to {not}have a display string equal to {expected:?}\n but was: \" {marked_actual}\" \n expected: {not}\" {marked_expected}\" " ,
177177 )
178178 }
179179}
180180
181- impl < E > Invertible for HasDisplayMessage < E > { }
181+ impl < E > Invertible for HasDisplayString < E > { }
0 commit comments