Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Oct 11, 2024
1 parent 35c3f05 commit 33aff7b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 26 deletions.
63 changes: 41 additions & 22 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ impl<'de> Deserializer<'de> {

/// Deserialize a type from a KDL string
pub fn from_str<'a, T>(input: &'a str) -> Result<T, KdlParseFailure>
where T: Deserialize<'a>
where
T: Deserialize<'a>,
{

}

#[derive(Debug, Error)]
Expand All @@ -46,55 +46,64 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
self.deserialize_map(visitor)
}

fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

Expand All @@ -104,7 +113,8 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

Expand All @@ -114,19 +124,22 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

Expand All @@ -137,13 +150,15 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

Expand All @@ -154,7 +169,8 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

Expand All @@ -165,19 +181,22 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}

fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de> {
V: de::Visitor<'de>,
{
todo!()
}
}
}
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ pub enum KdlErrorKind {
#[error(transparent)]
#[diagnostic(code(kdl::parse_float))]
ParseFloatError(ParseFloatError),

/// Tried to parse a negative number as an unsigned integer.
#[error("Tried to parse a negative number as an unsigned integer.")]
#[diagnostic(code(kdl::negative_unsigned))]
NegativeUnsignedError,

/// Generic parsing error. The given context string denotes the component
/// that failed to parse.
#[error("Expected {0}.")]
Expand All @@ -107,4 +107,4 @@ pub enum KdlErrorKind {
#[error("An unspecified parse error occurred.")]
#[diagnostic(code(kdl::other))]
Other,
}
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ mod v2_parser;
#[cfg(feature = "serde")]
pub mod de;
#[cfg(feature = "serde")]
pub mod se;
pub mod se;
1 change: 1 addition & 0 deletions src/se.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 33aff7b

Please sign in to comment.