Reserver does not need to be generic
維護者通常 2 天內回覆
@jerbaroo 已經在處理了。
開始於 2026年10月16日。
評估
研究方向
從 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 · 2 則留言 ·
維護者通常 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
-
難度 1/5 1 小時以內 新手友好度 88/100
pop-os/cosmic-comp#2956 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
libp2p/rust-libp2p#6694 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
EmbarkStudios/cargo-deny#910 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
tursodatabase/turso#10054 ·
維護者通常 1 天內回覆
-
build: Update rust version可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉dependencies
難度 2/5 1-3 小時 新手友好度 67/100
ibm-granite-community/granite-cli#229 ·
維護者通常 1 天內回覆