@@ -104,15 +104,15 @@ impl Value {
104104 /// Compares two values for equality.
105105 ///
106106 /// Equality comparisons do not convert strings to numbers or vice versa.
107- /// Tables, Functions, Threads, and Userdata are compared by reference:
107+ /// Tables, Functions, Threads, and UserData are compared by reference:
108108 /// two objects are considered equal only if they are the same object.
109109 ///
110- /// If Tables or Userdata have `__eq` metamethod then mlua will try to invoke it.
110+ /// If Tables or UserData have `__eq` metamethod then mlua will try to invoke it.
111111 /// The first value is checked first. If that value does not define a metamethod
112112 /// for `__eq`, then mlua will check the second value.
113113 /// Then mlua calls the metamethod with the two values as arguments, if found.
114- pub fn equals < T : AsRef < Self > > ( & self , other : T ) -> Result < bool > {
115- match ( self , other. as_ref ( ) ) {
114+ pub fn equals ( & self , other : & Self ) -> Result < bool > {
115+ match ( self , other) {
116116 ( Value :: Table ( a) , Value :: Table ( b) ) => a. equals ( b) ,
117117 ( Value :: UserData ( a) , Value :: UserData ( b) ) => a. equals ( b) ,
118118 ( a, b) => Ok ( a == b) ,
@@ -610,13 +610,6 @@ impl PartialEq for Value {
610610 }
611611}
612612
613- impl AsRef < Value > for Value {
614- #[ inline]
615- fn as_ref ( & self ) -> & Self {
616- self
617- }
618- }
619-
620613/// A wrapped [`Value`] with customized serialization behavior.
621614#[ cfg( feature = "serialize" ) ]
622615#[ cfg_attr( docsrs, doc( cfg( feature = "serialize" ) ) ) ]
0 commit comments