@@ -93,7 +93,7 @@ impl FieldPath {
9393 }
9494
9595 /// Returns the sequence of field selectors that make up this path
96- pub fn path ( & self ) -> & [ Field ] {
96+ pub fn parts ( & self ) -> & [ Field ] {
9797 & self . 0
9898 }
9999
@@ -177,7 +177,7 @@ impl FieldPath {
177177 }
178178
179179 /// Does the field referenced by the field path exist in the given dtype?
180- pub fn exists ( & self , dtype : DType ) -> bool {
180+ pub fn exists_in ( & self , dtype : DType ) -> bool {
181181 // Indexing a struct type always allocates anyway.
182182 self . resolve ( dtype) . is_some ( )
183183 }
@@ -244,7 +244,7 @@ mod tests {
244244 . into_iter ( )
245245 . map ( Field :: from)
246246 . collect_vec ( ) ;
247- assert_eq ! ( path. path ( ) , & fields) ;
247+ assert_eq ! ( path. parts ( ) , & fields) ;
248248
249249 let vec_path = FieldPath :: from ( fields) ;
250250 assert_eq ! ( vec_path. to_string( ) , "$A.$B.$C" ) ;
@@ -260,7 +260,7 @@ mod tests {
260260 ) ;
261261 let path = FieldPath :: from_name ( "a" ) ;
262262 assert_eq ! ( a_type, path. resolve( dtype. clone( ) ) . unwrap( ) ) ;
263- assert ! ( path. exists ( dtype) ) ;
263+ assert ! ( path. exists_in ( dtype) ) ;
264264 }
265265
266266 #[ test]
@@ -282,7 +282,7 @@ mod tests {
282282 let dtype = path. resolve ( outer. clone ( ) ) . unwrap ( ) ;
283283
284284 assert_eq ! ( dtype, DType :: Primitive ( PType :: U8 , NonNullable ) ) ;
285- assert ! ( path. exists ( outer) ) ;
285+ assert ! ( path. exists_in ( outer) ) ;
286286 }
287287
288288 #[ test]
@@ -314,40 +314,40 @@ mod tests {
314314 let dtype = path. resolve ( level1. clone ( ) ) . unwrap ( ) ;
315315
316316 assert_eq ! ( dtype, DType :: Primitive ( PType :: F64 , Nullable ) ) ;
317- assert ! ( path. exists ( level1. clone( ) ) ) ;
317+ assert ! ( path. exists_in ( level1. clone( ) ) ) ;
318318
319319 let path = FieldPath :: from_name ( "a" )
320320 . push ( "b" )
321321 . push ( "c" )
322322 . push ( Field :: ElementType ) ;
323323 assert ! ( path. resolve( level1. clone( ) ) . is_none( ) ) ;
324- assert ! ( !path. exists ( level1. clone( ) ) ) ;
324+ assert ! ( !path. exists_in ( level1. clone( ) ) ) ;
325325
326326 let path = FieldPath :: from_name ( "a" )
327327 . push ( Field :: ElementType )
328328 . push ( "b" )
329329 . push ( "c" ) ;
330330 assert ! ( path. resolve( level1. clone( ) ) . is_none( ) ) ;
331- assert ! ( !path. exists ( level1. clone( ) ) ) ;
331+ assert ! ( !path. exists_in ( level1. clone( ) ) ) ;
332332
333333 let path = FieldPath :: from_name ( Field :: ElementType )
334334 . push ( "a" )
335335 . push ( "b" )
336336 . push ( "c" ) ;
337337 assert ! ( path. resolve( level1. clone( ) ) . is_none( ) ) ;
338- assert ! ( !path. exists ( level1) ) ;
338+ assert ! ( !path. exists_in ( level1) ) ;
339339 }
340340
341341 #[ test]
342342 fn nested_field_not_found ( ) {
343343 let dtype = DType :: struct_ ( [ ( "a" , DType :: Bool ( NonNullable ) ) ] , NonNullable ) ;
344344 let path = FieldPath :: from_name ( "b" ) ;
345345 assert ! ( path. resolve( dtype. clone( ) ) . is_none( ) ) ;
346- assert ! ( !path. exists ( dtype. clone( ) ) ) ;
346+ assert ! ( !path. exists_in ( dtype. clone( ) ) ) ;
347347
348348 let path = FieldPath :: from ( Field :: ElementType ) ;
349349 assert ! ( path. resolve( dtype. clone( ) ) . is_none( ) ) ;
350- assert ! ( !path. exists ( dtype) ) ;
350+ assert ! ( !path. exists_in ( dtype) ) ;
351351 }
352352
353353 #[ test]
@@ -358,10 +358,10 @@ mod tests {
358358 ) ;
359359 let path = FieldPath :: from_name ( "a" ) . push ( "b" ) ;
360360 assert ! ( path. resolve( dtype. clone( ) ) . is_none( ) ) ;
361- assert ! ( !path. exists ( dtype. clone( ) ) ) ;
361+ assert ! ( !path. exists_in ( dtype. clone( ) ) ) ;
362362
363363 let path = FieldPath :: from_name ( "a" ) . push ( Field :: ElementType ) ;
364364 assert ! ( path. resolve( dtype. clone( ) ) . is_none( ) ) ;
365- assert ! ( !path. exists ( dtype) ) ;
365+ assert ! ( !path. exists_in ( dtype) ) ;
366366 }
367367}
0 commit comments