rust-lang / rust-lang/rustlings
[exersizes/conversions/as_ref_mut.rs] Why should I want to use AsRef / AsMut
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 64.2k
- Forks
- 11.3k
- Avg merge
- 5h 24m
- Merged PRs (30d)
- 2
Description
As a first time rust learner, after the as_ref_mut.rs lesson, I was left curious why AsRef or AsMut are valuable tools. Typically I look for a hint to provide these answers, however the hint is pretty lacking here:
Feature Request: Please provide a more elaborate explanation as to why AsRef or AsMut are so valueable, and why I would need to use them. Additionally, perhaps provide more unit tests also showcasing why I would want to use these two impls/methods.
(Just finished rustlings and really appreciate the work everyone has done on it! 🎉 💯 )
Contributor 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.
Research direction
Start with exercises/conversions/as_ref_mut.rs and read the existing lesson hint and examples. Expand the explanation of why AsRef and AsMut are useful, add unit-test examples that demonstrate those use cases, and confirm the exercise still teaches the intended conversions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100