Closed jordens closed 1 year ago
There are a few places where a separator is employed:
Miniconf::get()
and Miniconf::set()
default implementations.miniconf::Array
and [T; N]
implementations (recurse_paths()
function)It seems like the macro could (quite easily) expose a new attribute to specify the separator:
#[derive(Miniconf)]
#[miniconf(separator=':')]
struct Settings {
// ...
}
During code-gen, we could implement an overriden get()
and set()
function as well as updated path generation function. I'm not sure how we could fix up the default implementation for array
- perhaps the separator could be passed into the recurse_paths
function.
Or maybe next_path
can be restructured to return an iterator over path parts. Then the user (or iter_paths()
) can join each path.
~No real need to enforce a
Peekable<Split<char>>
. Maybe https://docs.rs/itertools/latest/itertools/trait.PeekingNext.html is enough.~get_path()
andset_path()
are now (with #105) generic over the path format and separator.next_path
andmetadata()
need redesign to make them agnostic.