FuelLabs/sway

Consider making `CompileResult` members private.

Open

#2,475 创建于 2022年8月8日

在 GitHub 查看
 (0 评论) (1 反应) (0 负责人)Rust (5,421 fork)batch import
P: mediumcode qualitycompiler: frontendenhancementgood first issueteam:compiler

仓库指标

Star
 (61,702 star)
PR 合并指标
 (平均合并 22小时 6分钟) (30 天内合并 16 个 PR)

描述

When reviewing #2472 I noticed it's possible to accidentally make an invalid CompileResult, where the author intended to return an 'ok' but set value to None.

We should make it mandatory to use CompileResult::ok() and CompileResult::err() to avoid this sort of thing. It would also required making a bunch of access methods for pulling the value or errors and/or warnings out which may turn out to be quite a pervasive change.

贡献者指南