Skip to content

Commit 7b3dbcd

Browse files
committed
Use 'd name for lifetime of reference to Deserializer
1 parent 535618b commit 7b3dbcd

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/de/map.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ enum ValueSource {
164164
/// internal buffer of deserializer (i.e. deserializer itself) or an input
165165
/// (in that case it is possible to approach zero-copy deserialization).
166166
///
167-
/// - `'a` lifetime represents a parent deserializer, which could own the data
167+
/// - `'d` lifetime represents a parent deserializer, which could own the data
168168
/// buffer.
169-
pub(crate) struct ElementMapAccess<'de, 'a, R, E>
169+
pub(crate) struct ElementMapAccess<'de, 'd, R, E>
170170
where
171171
R: XmlRead<'de>,
172172
E: EntityResolver,
173173
{
174174
/// Tag -- owner of attributes
175175
start: BytesStart<'de>,
176-
de: &'a mut Deserializer<'de, R, E>,
176+
de: &'d mut Deserializer<'de, R, E>,
177177
/// State of the iterator over attributes. Contains the next position in the
178178
/// inner `start` slice, from which next attribute should be parsed.
179179
iter: IterState,
@@ -192,14 +192,14 @@ where
192192
has_value_field: bool,
193193
}
194194

195-
impl<'de, 'a, R, E> ElementMapAccess<'de, 'a, R, E>
195+
impl<'de, 'd, R, E> ElementMapAccess<'de, 'd, R, E>
196196
where
197197
R: XmlRead<'de>,
198198
E: EntityResolver,
199199
{
200200
/// Create a new ElementMapAccess
201201
pub fn new(
202-
de: &'a mut Deserializer<'de, R, E>,
202+
de: &'d mut Deserializer<'de, R, E>,
203203
start: BytesStart<'de>,
204204
fields: &'static [&'static str],
205205
) -> Result<Self, DeError> {
@@ -214,7 +214,7 @@ where
214214
}
215215
}
216216

217-
impl<'de, 'a, R, E> MapAccess<'de> for ElementMapAccess<'de, 'a, R, E>
217+
impl<'de, 'd, R, E> MapAccess<'de> for ElementMapAccess<'de, 'd, R, E>
218218
where
219219
R: XmlRead<'de>,
220220
E: EntityResolver,
@@ -419,14 +419,14 @@ macro_rules! forward {
419419
///
420420
/// [`deserialize_tuple`]: #method.deserialize_tuple
421421
/// [`deserialize_struct`]: #method.deserialize_struct
422-
struct MapValueDeserializer<'de, 'a, 'm, R, E>
422+
struct MapValueDeserializer<'de, 'd, 'm, R, E>
423423
where
424424
R: XmlRead<'de>,
425425
E: EntityResolver,
426426
{
427427
/// Access to the map that created this deserializer. Gives access to the
428428
/// context, such as list of fields, that current map known about.
429-
map: &'m mut ElementMapAccess<'de, 'a, R, E>,
429+
map: &'m mut ElementMapAccess<'de, 'd, R, E>,
430430
/// Determines, should [`Deserializer::read_string_impl()`] expand the second
431431
/// level of tags or not.
432432
///
@@ -504,7 +504,7 @@ where
504504
allow_start: bool,
505505
}
506506

507-
impl<'de, 'a, 'm, R, E> MapValueDeserializer<'de, 'a, 'm, R, E>
507+
impl<'de, 'd, 'm, R, E> MapValueDeserializer<'de, 'd, 'm, R, E>
508508
where
509509
R: XmlRead<'de>,
510510
E: EntityResolver,
@@ -520,7 +520,7 @@ where
520520
}
521521
}
522522

523-
impl<'de, 'a, 'm, R, E> de::Deserializer<'de> for MapValueDeserializer<'de, 'a, 'm, R, E>
523+
impl<'de, 'd, 'm, R, E> de::Deserializer<'de> for MapValueDeserializer<'de, 'd, 'm, R, E>
524524
where
525525
R: XmlRead<'de>,
526526
E: EntityResolver,
@@ -691,14 +691,14 @@ impl<'de> TagFilter<'de> {
691691
///
692692
/// [`Text`]: crate::events::Event::Text
693693
/// [`CData`]: crate::events::Event::CData
694-
struct MapValueSeqAccess<'de, 'a, 'm, R, E>
694+
struct MapValueSeqAccess<'de, 'd, 'm, R, E>
695695
where
696696
R: XmlRead<'de>,
697697
E: EntityResolver,
698698
{
699699
/// Accessor to a map that creates this accessor and to a deserializer for
700700
/// a sequence items.
701-
map: &'m mut ElementMapAccess<'de, 'a, R, E>,
701+
map: &'m mut ElementMapAccess<'de, 'd, R, E>,
702702
/// Filter that determines whether a tag is a part of this sequence.
703703
///
704704
/// When feature [`overlapped-lists`] is not activated, iteration will stop
@@ -718,7 +718,7 @@ where
718718
}
719719

720720
#[cfg(feature = "overlapped-lists")]
721-
impl<'de, 'a, 'm, R, E> Drop for MapValueSeqAccess<'de, 'a, 'm, R, E>
721+
impl<'de, 'd, 'm, R, E> Drop for MapValueSeqAccess<'de, 'd, 'm, R, E>
722722
where
723723
R: XmlRead<'de>,
724724
E: EntityResolver,
@@ -728,7 +728,7 @@ where
728728
}
729729
}
730730

731-
impl<'de, 'a, 'm, R, E> SeqAccess<'de> for MapValueSeqAccess<'de, 'a, 'm, R, E>
731+
impl<'de, 'd, 'm, R, E> SeqAccess<'de> for MapValueSeqAccess<'de, 'd, 'm, R, E>
732732
where
733733
R: XmlRead<'de>,
734734
E: EntityResolver,
@@ -824,17 +824,17 @@ where
824824
///
825825
/// [`deserialize_tuple`]: #method.deserialize_tuple
826826
/// [`deserialize_struct`]: #method.deserialize_struct
827-
struct SeqItemDeserializer<'de, 'a, 'm, R, E>
827+
struct SeqItemDeserializer<'de, 'd, 'm, R, E>
828828
where
829829
R: XmlRead<'de>,
830830
E: EntityResolver,
831831
{
832832
/// Access to the map that created this deserializer. Gives access to the
833833
/// context, such as list of fields, that current map known about.
834-
map: &'m mut ElementMapAccess<'de, 'a, R, E>,
834+
map: &'m mut ElementMapAccess<'de, 'd, R, E>,
835835
}
836836

837-
impl<'de, 'a, 'm, R, E> SeqItemDeserializer<'de, 'a, 'm, R, E>
837+
impl<'de, 'd, 'm, R, E> SeqItemDeserializer<'de, 'd, 'm, R, E>
838838
where
839839
R: XmlRead<'de>,
840840
E: EntityResolver,
@@ -850,7 +850,7 @@ where
850850
}
851851
}
852852

853-
impl<'de, 'a, 'm, R, E> de::Deserializer<'de> for SeqItemDeserializer<'de, 'a, 'm, R, E>
853+
impl<'de, 'd, 'm, R, E> de::Deserializer<'de> for SeqItemDeserializer<'de, 'd, 'm, R, E>
854854
where
855855
R: XmlRead<'de>,
856856
E: EntityResolver,

src/de/var.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ use serde::de::value::BorrowedStrDeserializer;
99
use serde::de::{self, DeserializeSeed, Deserializer as _, Visitor};
1010

1111
/// An enum access
12-
pub struct EnumAccess<'de, 'a, R, E>
12+
pub struct EnumAccess<'de, 'd, R, E>
1313
where
1414
R: XmlRead<'de>,
1515
E: EntityResolver,
1616
{
17-
de: &'a mut Deserializer<'de, R, E>,
17+
de: &'d mut Deserializer<'de, R, E>,
1818
}
1919

20-
impl<'de, 'a, R, E> EnumAccess<'de, 'a, R, E>
20+
impl<'de, 'd, R, E> EnumAccess<'de, 'd, R, E>
2121
where
2222
R: XmlRead<'de>,
2323
E: EntityResolver,
2424
{
25-
pub fn new(de: &'a mut Deserializer<'de, R, E>) -> Self {
25+
pub fn new(de: &'d mut Deserializer<'de, R, E>) -> Self {
2626
EnumAccess { de }
2727
}
2828
}
2929

30-
impl<'de, 'a, R, E> de::EnumAccess<'de> for EnumAccess<'de, 'a, R, E>
30+
impl<'de, 'd, R, E> de::EnumAccess<'de> for EnumAccess<'de, 'd, R, E>
3131
where
3232
R: XmlRead<'de>,
3333
E: EntityResolver,
3434
{
3535
type Error = DeError;
36-
type Variant = VariantAccess<'de, 'a, R, E>;
36+
type Variant = VariantAccess<'de, 'd, R, E>;
3737

38-
fn variant_seed<V>(self, seed: V) -> Result<(V::Value, VariantAccess<'de, 'a, R, E>), DeError>
38+
fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error>
3939
where
4040
V: DeserializeSeed<'de>,
4141
{
@@ -62,25 +62,25 @@ where
6262
}
6363
}
6464

65-
pub struct VariantAccess<'de, 'a, R, E>
65+
pub struct VariantAccess<'de, 'd, R, E>
6666
where
6767
R: XmlRead<'de>,
6868
E: EntityResolver,
6969
{
70-
de: &'a mut Deserializer<'de, R, E>,
70+
de: &'d mut Deserializer<'de, R, E>,
7171
/// `true` if variant should be deserialized from a textual content
7272
/// and `false` if from tag
7373
is_text: bool,
7474
}
7575

76-
impl<'de, 'a, R, E> de::VariantAccess<'de> for VariantAccess<'de, 'a, R, E>
76+
impl<'de, 'd, R, E> de::VariantAccess<'de> for VariantAccess<'de, 'd, R, E>
7777
where
7878
R: XmlRead<'de>,
7979
E: EntityResolver,
8080
{
8181
type Error = DeError;
8282

83-
fn unit_variant(self) -> Result<(), DeError> {
83+
fn unit_variant(self) -> Result<(), Self::Error> {
8484
match self.de.next()? {
8585
// Consume subtree
8686
DeEvent::Start(e) => self.de.read_to_end(e.name()),
@@ -92,7 +92,7 @@ where
9292
}
9393
}
9494

95-
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, DeError>
95+
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error>
9696
where
9797
T: DeserializeSeed<'de>,
9898
{
@@ -107,7 +107,7 @@ where
107107
}
108108
}
109109

110-
fn tuple_variant<V>(self, len: usize, visitor: V) -> Result<V::Value, DeError>
110+
fn tuple_variant<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
111111
where
112112
V: Visitor<'de>,
113113
{
@@ -128,7 +128,7 @@ where
128128
self,
129129
fields: &'static [&'static str],
130130
visitor: V,
131-
) -> Result<V::Value, DeError>
131+
) -> Result<V::Value, Self::Error>
132132
where
133133
V: Visitor<'de>,
134134
{

0 commit comments

Comments
 (0)