Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Oct 24, 2024
1 parent 76fce8e commit a367b4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion miniconf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ It implements [`Keys`].

## Limitations

* `enum`: The derive macros don't support enums with record (named fields) variants or tuple variants with more than one field. Only unit, newtype and skipped variants are supported. Without the derive macros, these `enums` are still however usable in their atomic `serde` form as leaf nodes.
* `enum`: The derive macros don't support enums with record (named fields) variants or tuple variants with more than one field. Only unit, newtype and skipped variants are supported. Without the derive macros, these `enums` are still however usable in their atomic `serde` form as leaf nodes. Inline tuple variants are supported.
* The derive macros don't handle `std`/`alloc` smart pointers ( `Box`, `Rc`, `Arc`) in any special way. They however still be handled with accessors (`get`, `get_mut`, `validate`).
* The derive macros only support flattening in non-ambiguous situations (single field structs and single variant enums, both modulo skipped fields/variants and unit variants).

Expand Down
7 changes: 3 additions & 4 deletions miniconf/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum NodeType {

/// An internal node
///
/// A non-leaf node with zero or more leaf nodes below this node
/// A non-leaf node with one or more leaf nodes below this node
Internal,
}

Expand All @@ -36,6 +36,7 @@ pub struct Node {
///
/// This is the length of the key required to identify it.
pub depth: usize,

/// Leaf or internal
pub typ: NodeType,
}
Expand Down Expand Up @@ -133,7 +134,7 @@ impl Transcode for () {
M: TreeKey + ?Sized,
K: IntoKeys,
{
M::traverse_by_key(keys.into_keys(), |_index, _name, _len| Ok::<_, ()>(())).try_into()
M::traverse_by_key(keys.into_keys(), |_, _, _| Ok(())).try_into()
}
}

Expand Down Expand Up @@ -265,8 +266,6 @@ impl<T: Write + ?Sized, const S: char> Transcode for Path<T, S> {
}

/// Indices of `usize` to identify a node in a `TreeKey`
///
/// `T` can be `[usize; D]` for `Transcode` or `AsRef<[usize]>` for `IntoKeys` (see [`KeysIter`]).
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[repr(transparent)]
#[serde(transparent)]
Expand Down

0 comments on commit a367b4e

Please sign in to comment.