Skip to content

Commit

Permalink
Actually removing the option from Error
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed May 16, 2023
1 parent 492cabc commit e07b341
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,14 @@ impl<'a, 'de> VariantAccess<'de> for &'a mut Deserializer<'de> {

#[derive(Debug, Clone, PartialEq)]
pub struct Error {
pub location: Option<Range<usize>>,
pub location: Range<usize>,
pub kind: ErrorKind,
}

impl Error {
pub fn new(location: Range<usize>, kind: impl Into<ErrorKind>) -> Self {
Self {
location: location.into(),
location,
kind: kind.into(),
}
}
Expand All @@ -775,7 +775,7 @@ impl Error {
impl From<parser::Error> for Error {
fn from(err: parser::Error) -> Self {
Self {
location: Some(err.location),
location: err.location,
kind: err.kind.into(),
}
}
Expand Down

0 comments on commit e07b341

Please sign in to comment.