Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add traverse_by_key and {get,set}_by_key methods and refactor several things #160

Merged
merged 48 commits into from
Jul 28, 2023

Conversation

jordens
Copy link
Member

@jordens jordens commented Jul 27, 2023

  • remove the SerDe<Style> trait in favor of explicit and flexible individual traits
  • add closure-based traversal of the namespaces either by index or by name.
  • make ser/de generic over the type of key iterator. supported currently are indices and names.
  • make the traversal generally more powerful indicating where Errors or Ok originated
  • remove the separator from metadata, add helper method to account for it.

close #155

simplifies the interface
disentangles iter and style
* introduce separate traits JsonCoreSlash and JsonSlash
* and implement them for T: Miniconf
* this allows having them enabled a the same time and just putting them
  into scope disamiguates them.
@jordens jordens changed the title path add traverse_by_* methods with closure and refactor things Jul 27, 2023
@jordens jordens marked this pull request as ready for review July 27, 2023 15:56
@jordens jordens changed the title add traverse_by_* methods with closure and refactor things add traverse_by_{index,name} and {get,set}_by_index methods and refactor several things Jul 27, 2023
@jordens jordens changed the title add traverse_by_{index,name} and {get,set}_by_index methods and refactor several things add traverse_by_key and {get,set}_by_key methods and refactor several things Jul 28, 2023
Copy link
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are some very intriguing changes that make miniconf way more flexible. I'm very interested to see. Is the intent with the key refactor to allow arbitrary path/separator syntaxes to be used without affecting the fundamental operation of miniconf?

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
miniconf_derive/src/lib.rs Show resolved Hide resolved
miniconf_derive/src/lib.rs Outdated Show resolved Hide resolved
miniconf_derive/src/lib.rs Show resolved Hide resolved
src/json_core.rs Show resolved Hide resolved
src/iter.rs Show resolved Hide resolved
src/iter.rs Outdated Show resolved Hide resolved
tests/arrays.rs Outdated Show resolved Hide resolved
tests/index.rs Show resolved Hide resolved
@jordens
Copy link
Member Author

jordens commented Jul 28, 2023

These are some very intriguing changes that make miniconf way more flexible. I'm very interested to see. Is the intent with the key refactor to allow arbitrary path/separator syntaxes to be used without affecting the fundamental operation of miniconf?

Anything that can be turned into a usize (with the help of Miniconf) will be able to implement Key and thus work. I.e. pretty much any perfect hash.

@ryan-summers ryan-summers merged commit 2f91ecf into main Jul 28, 2023
16 checks passed
@ryan-summers ryan-summers deleted the path branch July 28, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shrink dependencies
2 participants