Remove usage of `try_into().unwrap()` where feasible
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Early versions of wsts used usize types anywhere that the code would deal with the size of memory. But this is problematic when sending data over the network, since usize is a platform dependent type.
So at some point we changed all public integer types to be fixed size, i.e. u32 or u64. This required sprinkling as usize casts where needed. However, @jferrant discovered that as usize casts will fail silently if the cast value is improperly sized.
As a result, we now call try_into().unwrap() to handle all casts between u32/u64 and usize. The logic was that while these can fail, they are extremely unlikely to do so, and if they do it's likely a result of a misconfiguration that should be noticed and fixed.
However, since this is library code, it is bad form to ever panic when an error could be returned instead. So this issue will track work to remove these unwrap calls whenever feasible.
- Dominant language
- Rust
- Stars
- 34
- Forks
- 19
- Avg merge
- 9h 19m
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xoloki/wsts
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
xoloki/wsts#256 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
difficulty: easy docs help wanted tooling
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
bug help wanted ui
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
userFRM/egui-charts#4386 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eliasstravik/herdr-projects#1605 · 1 comment ·