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

Implement Display for value::owned::Struct, value::owned::Sequence, etc. #447

Closed
jpschorr opened this issue Nov 5, 2022 · 1 comment
Closed

Comments

@jpschorr
Copy link
Contributor

jpschorr commented Nov 5, 2022

value::owned::Element implements Display: https://github.com/amzn/ion-rust/blob/main/src/value/owned.rs#L456-L483

But e.g., Struct, Sequence to not implement Display

So if I have a Struct (perhaps I've checked type and called as_struct on the Element and passed to another function), I can't easily display without something like Element::from(struct_.clone()).to_string()

zslayton added a commit that referenced this issue Mar 16, 2023
This PR performs several superficial cleanup tasks, including:
* Renames the `crate::value` module to `crate::element`
* Renames several types (and corresponding methods) to better align with [the official Ion type names](https://amazon-ion.github.io/ion-docs/docs/spec.html#the-ion-data-model)
  * `Boolean` -> `Bool`
  * `Integer` -> `Int`
  * `UInteger` -> `UInt`
  * `SExpression` -> `SExp` (this rename was started in an earlier PR, but additional references to the type name were found)
* Adds `Display` impls for `List`, `SExp`, and `Struct` (addressing #447)
* Adds `Display` impl for `Value` so it can eventually be used independent of `Element`.
* Modifies `Display` for `IonType` to use official type names
@zslayton
Copy link
Contributor

Fixed in #486, this will be included in the next release.

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

No branches or pull requests

2 participants