Skip to content

Commit

Permalink
ciborium: Replace qualified path to TagAccess with import
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrik Wolff <[email protected]>
  • Loading branch information
hw0lff committed Jul 24, 2024
1 parent c4b8169 commit 11bd3f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ciborium/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use ciborium_io::Read;
use ciborium_ll::*;
use serde::de::{self, value::BytesDeserializer, Deserializer as _};

use crate::tag::TagAccess;

trait Expected<E: de::Error> {
fn expected(self, kind: &'static str) -> E;
}
Expand Down Expand Up @@ -185,10 +187,8 @@ where
let result =
match self.integer(Some(Header::Tag(tag)), true, |b| bytes.push(b))? {
(false, _) if !bytes.is_empty() => {
let access = crate::tag::TagAccess::new(
BytesDeserializer::new(&bytes),
Some(tag),
);
let access =
TagAccess::new(BytesDeserializer::new(&bytes), Some(tag));
return visitor.visit_enum(access);
}
(false, raw) => return visitor.visit_u128(raw),
Expand All @@ -202,7 +202,7 @@ where
}

_ => self.recurse(|me| {
let access = crate::tag::TagAccess::new(me, Some(tag));
let access = TagAccess::new(me, Some(tag));
visitor.visit_enum(access)
}),
}
Expand Down Expand Up @@ -601,7 +601,7 @@ where
};

return self.recurse(|me| {
let access = crate::tag::TagAccess::new(me, tag);
let access = TagAccess::new(me, tag);
visitor.visit_enum(access)
});
}
Expand Down
6 changes: 4 additions & 2 deletions ciborium/src/value/de.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::tag::TagAccess;

use super::{Error, Integer, Value};

use alloc::{boxed::Box, string::String, vec::Vec};
Expand Down Expand Up @@ -236,7 +238,7 @@ impl<'a, 'de> de::Deserializer<'de> for Deserializer<&'a Value> {

Value::Tag(t, v) => {
let parent: Deserializer<&Value> = Deserializer(v);
let access = crate::tag::TagAccess::new(parent, Some(*t));
let access = TagAccess::new(parent, Some(*t));
visitor.visit_enum(access)
}

Expand Down Expand Up @@ -489,7 +491,7 @@ impl<'a, 'de> de::Deserializer<'de> for Deserializer<&'a Value> {
};

let parent: Deserializer<&Value> = Deserializer(val);
let access = crate::tag::TagAccess::new(parent, tag);
let access = TagAccess::new(parent, tag);
return visitor.visit_enum(access);
}

Expand Down

0 comments on commit 11bd3f0

Please sign in to comment.