@@ -148,7 +148,8 @@ pub fn get_return_identifier_name<'a>(body: &'a FunctionBody<'_>) -> Option<&'a
148148 }
149149}
150150
151- pub fn is_same_reference ( left : & Expression , right : & Expression , ctx : & LintContext ) -> bool {
151+ /// Compares two expressions to see if they are the same.
152+ pub fn is_same_expression ( left : & Expression , right : & Expression , ctx : & LintContext ) -> bool {
152153 if let Expression :: ChainExpression ( left_chain_expr) = left {
153154 if let Some ( right_member_expr) = right. as_member_expression ( ) {
154155 if let Some ( v) = left_chain_expr. expression . as_member_expression ( ) {
@@ -190,7 +191,7 @@ pub fn is_same_reference(left: &Expression, right: &Expression, ctx: &LintContex
190191 . expressions
191192 . iter ( )
192193 . zip ( right_str. expressions . iter ( ) )
193- . all ( |( left, right) | is_same_reference ( left, right, ctx) ) ;
194+ . all ( |( left, right) | is_same_expression ( left, right, ctx) ) ;
194195 }
195196 ( Expression :: NumericLiteral ( left_num) , Expression :: NumericLiteral ( right_num) ) => {
196197 return left_num. raw == right_num. raw ;
@@ -209,12 +210,12 @@ pub fn is_same_reference(left: &Expression, right: &Expression, ctx: &LintContex
209210 Expression :: BinaryExpression ( right_bin_expr) ,
210211 ) => {
211212 return left_bin_expr. operator == right_bin_expr. operator
212- && is_same_reference (
213+ && is_same_expression (
213214 left_bin_expr. left . get_inner_expression ( ) ,
214215 right_bin_expr. left . get_inner_expression ( ) ,
215216 ctx,
216217 )
217- && is_same_reference (
218+ && is_same_expression (
218219 left_bin_expr. right . get_inner_expression ( ) ,
219220 right_bin_expr. right . get_inner_expression ( ) ,
220221 ctx,
@@ -226,7 +227,7 @@ pub fn is_same_reference(left: &Expression, right: &Expression, ctx: &LintContex
226227 Expression :: UnaryExpression ( right_unary_expr) ,
227228 ) => {
228229 return left_unary_expr. operator == right_unary_expr. operator
229- && is_same_reference (
230+ && is_same_expression (
230231 left_unary_expr. argument . get_inner_expression ( ) ,
231232 right_unary_expr. argument . get_inner_expression ( ) ,
232233 ctx,
@@ -302,7 +303,7 @@ pub fn is_same_member_expression(
302303 }
303304 }
304305 _ => {
305- if !is_same_reference (
306+ if !is_same_expression (
306307 left. expression . get_inner_expression ( ) ,
307308 right. expression . get_inner_expression ( ) ,
308309 ctx,
@@ -313,7 +314,7 @@ pub fn is_same_member_expression(
313314 }
314315 }
315316
316- is_same_reference (
317+ is_same_expression (
317318 left. object ( ) . get_inner_expression ( ) ,
318319 right. object ( ) . get_inner_expression ( ) ,
319320 ctx,
0 commit comments