Skip to content

Commit 7d411bc

Browse files
committed
Centralise error positioning + cover custom de errors
1 parent 07f8d96 commit 7d411bc

14 files changed

+414
-280
lines changed

src/de/id.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use serde::de::{self, Visitor};
22

3-
use super::{Deserializer, Error, Result};
3+
use super::{Deserializer, ErrorCode};
4+
5+
type Result<T> = std::result::Result<T, ErrorCode>;
46

57
pub struct IdDeserializer<'a, 'b: 'a> {
68
d: &'a mut Deserializer<'b>,
@@ -13,7 +15,7 @@ impl<'a, 'b: 'a> IdDeserializer<'a, 'b> {
1315
}
1416

1517
impl<'a, 'b: 'a, 'c> de::Deserializer<'b> for &'c mut IdDeserializer<'a, 'b> {
16-
type Error = Error;
18+
type Error = ErrorCode;
1719

1820
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value>
1921
where

0 commit comments

Comments
 (0)