Skip to content

Clippy practice problems in Rust

Difficulty:
Category & tags Filters active
Category:
Tag:

Showing 50 of 68

Title Difficulty
Accept string-like values with AsRef Medium
A macro-generated FFI binding layer Hard
any, all, find, position: audit a list of records Easy
Arc: shared ownership across threads Easy
ASCII search without lowercase copies Easy
Balanced ranges: the arithmetic before the threads Easy
bool and char Easy
Build a configuration from defaults and overrides Easy
Build a generic stack with conditional methods Medium
Build a report with a reusable string buffer Medium
Cancel safety, blocking, and locks across .await Hard
Capstone: compose parser errors and their causes Hard
Choose parameter types and shrink an enum Medium
Convert temperatures with From and Into Medium
Countdown futures and the shape of Pending Easy
Count enum variants with matches! Easy
Cow: borrow until you have to own Medium
C strings and ownership across FFI Medium
Derive consistent ordering for versions and priorities Medium
Designing safe wrappers around unsafe FFI Hard
Documenting failure: # Errors and # Panics Medium
Eager vs lazy defaults Easy
Expose a string view with Deref Medium
Filter borrowed values into owned results Medium
fold and try_fold: a total that refuses to overflow Medium
Format money with Display Easy
Generics, traits and lifetimes in one signature Medium
Group and count words with BTreeMap entries Medium
Implement Iterator by hand: the Collatz sequence Medium
Keep a guard alive with a named binding Medium
loop, while, for, and break with a value Easy
Make hashing agree with equality Medium
Make the lint happy: '_ in return paths Easy
map, filter, filter_map: parse host:port lines Easy
Method receivers and the consuming builder Medium
#[must_use] in depth Medium
Pointer arithmetic: offset, add, sub, wrapping_* Medium
poll_fn: a future from a closure Easy
Propagating with ? Easy
ptr::read, write, copy, copy_nonoverlapping, drop_in_place Medium
Ranges: .., ..=, and range patterns Easy
Rc<RefCell<T>>: shared inboxes and an arena alternative Hard
Rc<str>: sharing interned strings Medium
Reduce an enum’s inline size with Box Medium
Remove duplicates while preserving order Easy
Replace a manual default with a derive Easy
Result, and why it is #[must_use] Easy
Result combinators and map_err Easy
Return a grade with an if expression Easy
Safety comments as a discipline: // SAFETY: and # Safety Easy