@@ -8,8 +8,6 @@ use pyo3::types::{PyList, PyTuple};
88use serde:: ser:: SerializeSeq ;
99use serde:: { Serialize , Serializer } ;
1010
11- use crate :: lookup_key:: { LookupPath , PathItem } ;
12-
1311/// Used to store individual items of the error location, e.g. a string for key/field names
1412/// or a number for array indices.
1513#[ derive( Clone , Eq , PartialEq , IntoPyObjectRef ) ]
@@ -71,20 +69,6 @@ impl From<usize> for LocItem {
7169 }
7270}
7371
74- /// eventually it might be good to combine PathItem and LocItem
75- impl From < PathItem > for LocItem {
76- fn from ( path_item : PathItem ) -> Self {
77- match path_item {
78- PathItem :: S ( s, _) => s. into ( ) ,
79- PathItem :: Pos ( val) => val. into ( ) ,
80- PathItem :: Neg ( val) => {
81- let neg_value = -( val as i64 ) ;
82- neg_value. into ( )
83- }
84- }
85- }
86- }
87-
8872impl Serialize for LocItem {
8973 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
9074 where
@@ -137,17 +121,6 @@ impl<'py> IntoPyObject<'py> for &'_ Location {
137121 }
138122}
139123
140- impl From < & LookupPath > for Location {
141- fn from ( lookup_path : & LookupPath ) -> Self {
142- let v = lookup_path
143- . iter ( )
144- . rev ( )
145- . map ( |path_item| path_item. clone ( ) . into ( ) )
146- . collect ( ) ;
147- Self :: List ( v)
148- }
149- }
150-
151124impl fmt:: Display for Location {
152125 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
153126 match self {
0 commit comments