[exersizes/conversions/as_ref_mut.rs] Why should I want to use AsRef / AsMut

未关闭
#1,350 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
documentation

调研方向

从 exercises/conversions/as_ref_mut.rs 开始,阅读现有的课程提示和示例。扩展对 AsRef 和 AsMut 为什么有用的说明,添加展示这些用例的单元测试示例,并确认该练习仍然教授预期的转换。

由索引模型根据 Issue 内容生成。

描述

A-exercises C-enhancement

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! 🎉 💯 )

主要语言
Rust
星标
64.8k
派生
11.3k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rust-lang/rustlings 的其他 Issue

查看 rust-lang/rustlings 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。