Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`ArrayExt` trait

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
rust

调研方向

先阅读现有的 AsArrayRef 和 AsArrayMut trait 以及 Array::slice_* 方法,然后将它们的 API 与 core 中对应的 slice 和 array 方法进行比较。该 issue 需要在实现前确定命名方案和范围;当约定的扩展 trait 和对应方法都已完成规范定义并得到一致实现时,即视为完成。

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

描述

We currently have AsArrayRef and AsArrayMut traits. #167 noted as_array_mut is inconsistent with core::slice's as_mut_array.

The issue made me think perhaps we should have more general and extensible extension traits, something like:

  • ArrayExt
  • ArrayMutExt (or MutArrayExt?) (unnecessary, just put mut methods on `ArrayExt)
  • SliceExt implemented
  • SliceMutExt (or MutSliceExt?) (unnecessary)

The existing AsArrayRef/AsArrayMut are impl'd for both Array and core [T; N]. The idea is ArrayExt/ArrayMutExt could also be impl'd for both, and SliceExt/SliceMutExt could be impl'd for core [T].

We already provide some methods for slice conversions as Array::slice_* (which should probably stay there so they can be const fn), but it would be nice to have those directly callable from core slices via Slice(Mut)Ext.

An important question is what naming scheme do we use so we can provide parallel methods to core but which operate on hybrid_array::Array instead of core's [T; N]?

In #167 I suggested we could so something like SliceExt::as_harray to disambiguate from [T]::as_array. A wrapper for our existing Array::slice_as_chunks could perhaps be SliceExt::as_hchunks.

主要语言
Rust
星标
23
派生
25
平均合并
1 小时 46 分钟
30 天内合并 PR
1

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

RustCrypto/hybrid-array 的其他 Issue

查看 RustCrypto/hybrid-array 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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