Skip to content

Commit

Permalink
Centralise error positioning + cover custom de errors
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Dec 30, 2021
1 parent 07f8d96 commit 7d411bc
Show file tree
Hide file tree
Showing 14 changed files with 414 additions and 280 deletions.
6 changes: 4 additions & 2 deletions src/de/id.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use serde::de::{self, Visitor};

use super::{Deserializer, Error, Result};
use super::{Deserializer, ErrorCode};

type Result<T> = std::result::Result<T, ErrorCode>;

pub struct IdDeserializer<'a, 'b: 'a> {
d: &'a mut Deserializer<'b>,
Expand All @@ -13,7 +15,7 @@ impl<'a, 'b: 'a> IdDeserializer<'a, 'b> {
}

impl<'a, 'b: 'a, 'c> de::Deserializer<'b> for &'c mut IdDeserializer<'a, 'b> {
type Error = Error;
type Error = ErrorCode;

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value>
where
Expand Down
Loading

0 comments on commit 7d411bc

Please sign in to comment.