Reserver does not need to be generic
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 issue 中引用的 Reserver 结构体及其 Debug 和固有 impl 代码块开始,然后找到 Reserver<ChunkId, ChunkId> 被构造和使用的位置。移除类型参数,使字段 reservations 和 pending_removals 直接使用 ChunkId,并相应更新 impl 代码块和调用位置。当 crate 能通过 cargo check 编译,且现有测试能通过 cargo test 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
The Reserver<K,V> currently has two type parameters, but is only ever created as Reserver<ChunkId, ChunkId>. Removing the type parameters and making the Reserver non-generic will make it more simple.
The current generic code:
pub struct Reserver<K, V> {
reservations: Cache<K, (V, UnboundedSender<V>, Instant), FxBuildHasher>,
pending_removals: Arc<Mutex<DelayQueue<K>>>,
}
impl<K, V> core::fmt::Debug for Reserver<K, V>
where
K: Hash + Eq + Send + Sync + Debug + Copy + 'static,
V: Send + Sync + Clone + Debug + 'static,
{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Reserver")
.field("reservations", &self.reservations)
.field("&pending_removals", &self.pending_removals)
.finish()
}
}
impl<K, V> Reserver<K, V>
where
K: Hash + Eq + Send + Sync + Debug + Copy + 'static,
V: Send + Sync + Clone + 'static,
- 主要语言
- Rust
- 星标
- 96
- 派生
- 2
- 平均合并
- 8 天 22 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
channable/opsqueue 的其他 Issue
-
Make `submissions_canceled` and `add_chunks_done_to_submissions_failed` migrations bidirectional未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
channable/opsqueue#193 · 1 条评论 ·
维护者通常 2 天内回复
-
discussion
难度 5/5 一周以上 新手友好度 30/100
channable/opsqueue#188 · 1 个 reaction ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
channable/opsqueue#182 · 4 条评论 ·
维护者通常 2 天内回复
查看 channable/opsqueue 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
dependencies effort:low flow:chore rust
难度 2/5 1-3 小时 新手友好度 64/100
jaroslawherod/micold-ai-ide#875 ·
维护者通常 1 天内回复
-
priority: low
难度 2/5 1-3 小时 新手友好度 65/100
storytold/photocraft#6286 · 1 条评论 ·
维护者通常 1 天内回复
-
Four problem loader browser tests fail on Windows可能已有人在做 @Patriciaath999 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
Kazakh (kk_KZ) and Georgian (ka_GE) system locales get English instead of the shipped translations未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复