Skip to content

Don't explicitly panic or block when avoidable#147

Merged
james7132 merged 3 commits intosmol-rs:masterfrom
james7132:dont-panic
Aug 24, 2025
Merged

Don't explicitly panic or block when avoidable#147
james7132 merged 3 commits intosmol-rs:masterfrom
james7132:dont-panic

Conversation

@james7132
Copy link
Copy Markdown
Contributor

@james7132 james7132 commented Aug 24, 2025

This crate has a number of unwraps and asserts that could be avoided and result in a bit of extra, potentially unnecessary, codegen, and its use of a std RwLock/Mutex does result in unnecessary blocking.

This PR converts any explicitly done (read: non-allocator) panics into handled errors, as well as moves stealing to not block when it cannot obtain a read lock on the queues.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@james7132 james7132 merged commit 08c3fc4 into smol-rs:master Aug 24, 2025
8 checks passed
@notgull notgull mentioned this pull request Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants