next.js
be94eda3 - refactor(turbo-tasks): Use an enum for `strongly_consistent`/`ReadConsistency` instead of a bool (#68913)

Commit
1 year ago
refactor(turbo-tasks): Use an enum for `strongly_consistent`/`ReadConsistency` instead of a bool (#68913) This should be completely equivalent. Double checked the diff and made sure that the conversions from `true`/`false` to `ReadConsistency::Strong`/`ReadConsistency::Eventual` are correct. ## Why? Without keyword arguments in the language, boolean arguments can be hard to read. Inlay hints and type-signature-on-hover with rust-analyzer help, but it's more obvious what these do if they use a clearly labeled enum. E.g. discussion: https://www.reddit.com/r/rust/comments/bm6s3t/rust_patterns_enums_instead_of_booleans/ Unlike my other change from a bool to an enum in #68866, I don't expect that we'd ever introduce more levels of read consistency than eventual and strong, so this PR is only about readability.
Author
bgw bgw
Parents
Loading