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

refactor(snapbox)!: Change try_text to try_coerce #111

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

Muscraft
Copy link
Collaborator

@Muscraft Muscraft commented Jul 19, 2022

This changes try_text into try_coerce to support changing of a Data's underlying DataFormat to more than just Text.

This adds try_coerce which can be extended to allow conversion between different DataFormats. This also adds Data::format which gives the current DataFormat of the underlying Data. This is useful for when you are trying to convert one Data to another Data's DataFormat (actual.try_coerce(expected.format()))

crates/snapbox/src/path.rs Outdated Show resolved Hide resolved
crates/snapbox/src/assert.rs Outdated Show resolved Hide resolved
crates/snapbox/src/assert.rs Outdated Show resolved Hide resolved
crates/snapbox/src/data.rs Outdated Show resolved Hide resolved
crates/snapbox/src/data.rs Outdated Show resolved Hide resolved
crates/snapbox/src/data.rs Outdated Show resolved Hide resolved
crates/snapbox/src/assert.rs Outdated Show resolved Hide resolved
@Muscraft Muscraft changed the title refactor(snapbox)!: Change try_text to coerce refactor(snapbox)!: Change try_text to try_coerce Jul 19, 2022
crates/snapbox/src/path.rs Outdated Show resolved Hide resolved
crates/snapbox/src/path.rs Outdated Show resolved Hide resolved
@epage epage merged commit d6b2c3c into assert-rs:main Jul 19, 2022
@Muscraft Muscraft deleted the data-format-support branch July 19, 2022 21:46
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.

None yet

2 participants