@@ -8,8 +8,6 @@ use pyo3::types::{PyList, PyTuple};
8
8
use serde:: ser:: SerializeSeq ;
9
9
use serde:: { Serialize , Serializer } ;
10
10
11
- use crate :: lookup_key:: { LookupPath , PathItem } ;
12
-
13
11
/// Used to store individual items of the error location, e.g. a string for key/field names
14
12
/// or a number for array indices.
15
13
#[ derive( Clone , Eq , PartialEq , IntoPyObjectRef ) ]
@@ -71,20 +69,6 @@ impl From<usize> for LocItem {
71
69
}
72
70
}
73
71
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
-
88
72
impl Serialize for LocItem {
89
73
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
90
74
where
@@ -137,17 +121,6 @@ impl<'py> IntoPyObject<'py> for &'_ Location {
137
121
}
138
122
}
139
123
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
-
151
124
impl fmt:: Display for Location {
152
125
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
153
126
match self {
0 commit comments