Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

WriteAllError type #18

Merged
merged 1 commit into from
Jun 20, 2023
Merged

WriteAllError type #18

merged 1 commit into from
Jun 20, 2023

Conversation

MabezDev
Copy link
Contributor

Closes #15

Instead of panicking when writing zero bytes with write_all, it now returns a WriteZeroError.

I couldn't see an easy way to avoid duplicating the WriteZero variant in WriteFmtError, but it would be nice to not have this duplication.

src/blocking.rs Outdated Show resolved Hide resolved
src/blocking.rs Outdated Show resolved Hide resolved
src/blocking.rs Outdated Show resolved Hide resolved
@Dirbaio
Copy link
Member

Dirbaio commented May 10, 2023

Could you do the equivalent changes in asynch? so that they're consistent.

Instead of panicking when writing zero byte with `write_all`, it now
returns a `WriteZeroError`.
@MabezDev
Copy link
Contributor Author

Could you do the equivalent changes in asynch? so that they're consistent.

Done :)

@MabezDev MabezDev changed the title write zero error type WriteAllError type May 11, 2023
@MabezDev
Copy link
Contributor Author

@Dirbaio, sorry for the ping! Any more thoughts on this PR?

@Dirbaio Dirbaio merged commit f6ee1ec into embassy-rs:master Jun 20, 2023
@Dirbaio
Copy link
Member

Dirbaio commented Jun 20, 2023

LGTM. This is a breaking change though. It'll require releasing 0.5 though, which is a breaking change. I wonder if there's other breaking changes we might wish to do before that?

@MabezDev
Copy link
Contributor Author

Nothing off the top of my head. The only other open issue is #17 which won't be a breaking change anyway as the enum is marked as non-exhaustive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid panicing on failure to write_all
2 participants