Skip to content

Commit

Permalink
Renamed the de::Visitor; small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Nov 1, 2023
1 parent 2c174b7 commit c737d9b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions hybrid-array/src/impl_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// https://github.com/fizyk20/generic-array/blob/0e2a03714b05bb7a737a677f8df77d6360d19c99/src/impl_serde.rs

use crate::{Array, ArraySize};
use core::fmt;
use core::marker::PhantomData;
use serde::de::{self, SeqAccess, Visitor};
use serde::{ser::SerializeTuple, Deserialize, Deserializer, Serialize, Serializer};
use core::{fmt, marker::PhantomData};
use serde::{
de::{self, SeqAccess, Visitor},
ser::SerializeTuple,
Deserialize, Deserializer, Serialize, Serializer,
};

impl<T, N: ArraySize> Serialize for Array<T, N>
where
Expand All @@ -25,7 +27,7 @@ where
}
}

struct GAVisitor<T, N> {
struct ArrayVisitor<T, N> {
_t: PhantomData<T>,
_n: PhantomData<N>,
}
Expand All @@ -41,7 +43,7 @@ impl<'de> Deserialize<'de> for Dummy {
}
}

impl<'de, T, N: ArraySize> Visitor<'de> for GAVisitor<T, N>
impl<'de, T, N: ArraySize> Visitor<'de> for ArrayVisitor<T, N>
where
T: Deserialize<'de>,
{
Expand Down Expand Up @@ -87,7 +89,7 @@ where
where
D: Deserializer<'de>,
{
let visitor = GAVisitor {
let visitor = ArrayVisitor {
_t: PhantomData,
_n: PhantomData,
};
Expand Down

0 comments on commit c737d9b

Please sign in to comment.