@@ -230,21 +230,6 @@ impl Display for Error {
230230 ErrorKind :: UnexpectedValue { expected, .. } => write ! ( f, "expected '{expected:?}'" ) ?,
231231 }
232232
233- // if !self.key.is_empty() {
234- // write!(f, " for key `")?;
235- // for (i, k) in self.key.iter().enumerate() {
236- // if i > 0 {
237- // write!(f, ".")?;
238- // }
239- // write!(f, "{}", k)?;
240- // }
241- // write!(f, "`")?;
242- // }
243-
244- // if let Some(line) = self.line {
245- // write!(f, " at line {} column {}", line + 1, self.col + 1)?;
246- // }
247-
248233 Ok ( ( ) )
249234 }
250235}
@@ -262,7 +247,7 @@ impl Error {
262247
263248 use codespan_reporting:: diagnostic:: Label ;
264249
265- let diag = match & self . kind {
250+ match & self . kind {
266251 ErrorKind :: DuplicateKey { first, .. } => diag. with_labels ( vec ! [
267252 Label :: secondary( fid, * first) . with_message( "first key instance" ) ,
268253 Label :: primary( fid, self . span) . with_message( "duplicate key" ) ,
@@ -352,9 +337,7 @@ impl Error {
352337 ErrorKind :: Custom ( msg) => diag
353338 . with_message ( msg. to_string ( ) )
354339 . with_labels ( vec ! [ Label :: primary( fid, self . span) ] ) ,
355- } ;
356-
357- diag
340+ }
358341 }
359342}
360343
0 commit comments