From 4bae487b8f8175349baddcbd3b8cb3a711e8990d Mon Sep 17 00:00:00 2001 From: Hendrik Wolff Date: Thu, 25 Jul 2024 00:59:34 +0200 Subject: [PATCH] ciborium: Replace qualified path to TagAccess with import Signed-off-by: Hendrik Wolff --- ciborium/src/de/mod.rs | 12 ++++++------ ciborium/src/value/de.rs | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ciborium/src/de/mod.rs b/ciborium/src/de/mod.rs index 5add6b8..18742e4 100644 --- a/ciborium/src/de/mod.rs +++ b/ciborium/src/de/mod.rs @@ -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 { fn expected(self, kind: &'static str) -> E; } @@ -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), @@ -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) }), } @@ -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) }); } diff --git a/ciborium/src/value/de.rs b/ciborium/src/value/de.rs index 30e69ee..f58a017 100644 --- a/ciborium/src/value/de.rs +++ b/ciborium/src/value/de.rs @@ -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}; @@ -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) } @@ -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); }