Replace assert!(matches!(...)) with assert_matches!
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with the 31 listed call sites in the issue, replacing only assertion uses of matches!; leave the listed boolean-expression uses unchanged. Add use std::assert_matches; in each affected Rust file, preserving guards and custom messages. Check the multi-line assertion in tellus/src/persistence_tests.rs, the doc example in tellus/src/testing.rs, and the example in docs/persistence.md; done when all listed call sites use the new macro and the examples remain valid.
Written by the indexing model from the issue text.
Description
std::assert_matches! is stable on our pinned toolchain (1.99.0). On failure it prints the actual value, whereas assert!(matches!(...)) only reports "assertion failed". It takes guards (if ...) and a custom message like assert!, so every call site converts one to one; each file needs use std::assert_matches;, as the macro is not in the prelude.
Call sites on main (31):
tellus/src/actor_config.rs: 179, 183, 216tellus/src/mailbox.rs: 258, 274, 291, 319, 320, 347, 377, 393, 394, 400, 477tellus/src/quota.rs: 173, 232, 247, 265, 276, 309tellus/src/persistence/versioned.rs: 188tellus/src/persistence_tests.rs: 94, 145 (multi-lineassert!(with a message)tellus/tests/ask.rs: 58, 88, 105, 123 (with a guard), 161, 247tellus/src/testing.rs: 230 (doc example, so it shows in the API docs)docs/persistence.md: 253 (example)
Not in scope: matches! used as a boolean expression (tellus/src/mailbox.rs 71 and 81, tellus/tests/persistence.rs 135, tellus-persistence-postgres/src/lib.rs 264).
The unit-testing how-to tests, coming with the docs PR for the event-sourced tutorial, use assert_matches! already.
- Dominant language
- Rust
- Stars
- 37
- Forks
- 1
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 123
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
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 tellus-rs/tellus
-
fix(cluster): keep a panicking encode of a remote reply from failing the responderPossibly taken @cosmir17 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tellus-rs/tellus#312 · 2 comments ·
Maintainers usually reply within 1 day
-
docs: document the PostgreSQL store's schema for applications managing their ownPossibly taken @cosmir17 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
tellus-rs/tellus#310 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation question
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
tellus-rs/tellus#311 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in tellus-rs/tellus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ElectronicWave/Elemental#252 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area:mcp effort:low P5 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jlcodes99/cockpit-tools#3103 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
eliasstravik/herdr-projects#1032 ·