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

feat: Added Gura support #467

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 7, 2023

  1. feat: Added Gura support

    Signed-off-by: Brennan Kinney <[email protected]>
    mkvolkov authored and polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    d03821e View commit details
    Browse the repository at this point in the history
  2. chore: Add gura to README

    Signed-off-by: Brennan Kinney <[email protected]>
    mkvolkov authored and polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    41ef19e View commit details
    Browse the repository at this point in the history
  3. chore: Review feedback

    - `ura` => `gura` corrections
    - `src/lib.rs` add mention for Gura support
    
    tests(fix): Use `FileFormat::Gura`
    chore: Version bump `gura`
    
    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    061f45b View commit details
    Browse the repository at this point in the history
  4. chore: Appease the linting gods

    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    48d7de8 View commit details
    Browse the repository at this point in the history
  5. refactor: from_gura_value (json referenced)

    This method seems to be adapted from `format/json.rs:from_json_value()`.
    - I adjusted the order of matched types to mirror that of `format/json.rs`.
    - `val` => `value`.
    - No need to dereference values, in this case we consume the `value` parameter,
      rather than expect a reference to borrow.
      No need to use `ref` or `clone()` to create owned values.
    - Potential Improvement: Adopt the iter + collect pattern used by other formats
      instead of the `for` loop used for array and object types here.
    
    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    04254a8 View commit details
    Browse the repository at this point in the history
  6. refactor: from_gura_value (json5 referenced)

    Now adapted to the better approach handled by json5 equivalent method.
    - DRY, avoid the value wrapper reptition via storing the match value and 
      using a final return afterwards to value wrap: `Value::new(uri, vk)`.
    - Object and Array kinds now adopt the json5 iter + collect approach.
    
    Additionally corrects the `Cargo.toml` feature `ura` to `gura`.
    As the feature name conflicts with the equivalent dependency name, 
    the feature needs to prefix the dependency with `dep:`, 
    removing the need for the package to include `pacakge = "gura"`.
    
    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    73e4304 View commit details
    Browse the repository at this point in the history
  7. chore: Use the common parser root check method

    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    0b781b8 View commit details
    Browse the repository at this point in the history
  8. chore: Switch to serde_gura

    - No `.unwrap()` concern now.
    - Leverage the common `from_parsed_value` method.
    - Greatly simplified format support.
    
    Signed-off-by: Brennan Kinney <[email protected]>
    polarathene committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    4140214 View commit details
    Browse the repository at this point in the history