FuelLabs/sway

Consider making `CompileResult` members private.

Open

#2.475 geöffnet am 8. Aug. 2022

Auf GitHub ansehen
 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (5.421 Forks)batch import
P: mediumcode qualitycompiler: frontendenhancementgood first issueteam:compiler

Repository-Metriken

Stars
 (61.702 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 22h 6m) (16 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide