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 as_bytes to to_bytes #110

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

Muscraft
Copy link
Collaborator

@Muscraft Muscraft commented Jul 18, 2022

This renames as_bytes to to_bytes so we can write out to disk Data formats that will need more work to be serialized, like json.

These changes were motivated by this comment

Copy link
Contributor

@epage epage left a comment

Choose a reason for hiding this comment

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

I stopped part way through this. This PR completely removes the functions, changing them to their new variant even when that isn't the long term plan for those callers. I'd prefer this instead focus only only changing the long term call sites. If that means we do this after other PRs, I can go either way.

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/path.rs Outdated Show resolved Hide resolved
crates/snapbox/src/path.rs Outdated Show resolved Hide resolved
src/runner.rs Outdated Show resolved Hide resolved
@Muscraft Muscraft changed the title update as_bytes to to_bytes and as_str to try_string update as_bytes to to_bytes Jul 18, 2022
@Muscraft
Copy link
Collaborator Author

It looks like try_string will be related to coerce. I changed this so it was only updating as_bytes to to_bytes. I will look at everything with try_string within another PR.

@epage epage changed the title update as_bytes to to_bytes refactor(snapbox)!: Change as_bytes to to_bytes Jul 18, 2022
@epage epage merged commit 6b98513 into assert-rs:main Jul 18, 2022
@Muscraft Muscraft deleted the data-format-support branch July 18, 2022 20:33
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