Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Propagate per-entry errors from Path.list!

已關閉
#440 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
64/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
冷清
技術堆疊
rust
領域
cli

研究方向

從 src/lib.rs:1173-1177 開始,檢查 hosted_dir_list、現有的目錄錯誤轉換,以及 Path.list! 進入點。使用可控制的抽象或檔案系統競態 harness,為 ReadDir 項目產生的錯誤新增涵蓋範圍,同時保留 Unix 和 Windows 上的成功行為以及非目錄行為。

由索引模型根據 Issue 內容生成。

描述

bug

Context

hosted_dir_list currently discards errors produced while iterating an otherwise successfully opened directory:

let entries = read_dir
    .filter_map(|entry| entry.ok().map(|entry| entry.path()))
    .collect();

See src/lib.rs:1173-1177.

This can return an incomplete list as Ok when an entry disappears during iteration or the filesystem reports an I/O error. Because Path.list! already returns a Try, silently returning partial data is surprising and can lead applications to make incorrect decisions.

Suggested direction

Collect the iterator as a Result<Vec<_>, io::Error> and map the first entry error through the existing directory error conversion. If partial results are considered useful, expose them through a deliberately different API and result type.

Acceptance criteria

  • An error from any ReadDir entry is not silently dropped.
  • Path.list! returns either a complete snapshot-like result or a typed error.
  • Tests exercise the error branch through a controllable abstraction or filesystem race harness.
  • Existing success and non-directory cases continue to pass on Unix and Windows.
主要語言
Rust
星號
123
分支
46
平均合併
10 小時 59 分鐘
30 天內合併 PR
21

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

roc-lang/basic-cli 的其他 Issue

查看 roc-lang/basic-cli 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。