Skip to content

Commit

Permalink
Remove some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Oct 4, 2024
1 parent 0b5a560 commit 7b367d7
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/serde_xml_plist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ mod de {

pub(super) struct DictWrapper(pub(super) Dictionary);

struct ValueWrapper;

struct ArrayWrapper(Vec<Value>);

struct IntWrapper(plist::Integer);
Expand All @@ -63,30 +61,6 @@ mod de {
False,
}

// the logic for deserializing a dict is a subset of the general deser logic,
// so we reuse this type for both cases.
struct ValueVisitor;

impl<'de> Visitor<'de> for ValueVisitor {
type Value = Value;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("plist value")
}

fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
A::Error: DeError,
{
match read_xml_value(&mut map) {
Ok(Some(val)) => Ok(val),
Ok(None) => Err(A::Error::custom("expected value")),
Err(e) => Err(e),
}
}
}

/// shared helper for deserializing a plist value from the serde map repr used by quick_xml
///
/// if `dict_only` is true, this will reject values that are not dicts.
Expand Down Expand Up @@ -130,15 +104,6 @@ mod de {
value.map(Some)
}

impl<'de> Deserialize<'de> for ValueWrapper {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
deserializer.deserialize_any(ValueVisitor).map(|_| ValueWrapper)
}
}

impl<'de> Deserialize<'de> for DictWrapper {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down

0 comments on commit 7b367d7

Please sign in to comment.