Skip to content

Feature request: Return Difference instead of String for assert_json_matches_no_panic #1

@B-2U

Description

@B-2U

Hi there,
first of all, thank you for forking serde-json-diff and add the epsilon floats comparison!

I just came across this crate after forking serde-json-diff a few days ago , and I would prefer to use this one instead of reinventing the wheel myself.

One of my use case is to expose and return the Difference<'> in the assert_json_matches_no_panic() function.
This would allow me to perform further processing with the diffs.

However, this raised a lifetime problem. I created an issue with details in my own repository: B-2U/assert-json-same#4.

TLDR:

  1. Make Difference an owned type => slow down the crate completely
  2. Change the function signature so it take two serde_json::Value ownership instead => it break the flexibility of the api
  3. Current approach, introduce the owned types variants DifferenceBuf, PathBuf and KeyBuf, like str/String and Path/PathBuf

So I wonder would you prefer any of them?

Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions