You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make PathsByRole::maybe_pf_64bit an Option<PathBuf>
The `PathsByRole` test helper struct's `maybe_pf_64bit` member was
previously `Result<PathBuf, std::io::Error>`. But construction,
which is by `PathsByRole::obtain_envlessly()`, already asserted the
expected existence of the other two paths. It should likewise
assert that if the guaranteed-64-bit program files path cannot be
obtained from the registry, then this is due to it being absent,
rather than some other error.
Checking this in `obtain_envlessly()` makes it reasonable for
`maybe_pf_64bit` to be an `Option<PathBuf>`, as its name would
suggest it should be. This in turn makes clear that all the
validation and assertions for this "reference value" have already
been done. Thus `PathsByRole::validate()` can continue omitting
validation for the error type, validation it should not perform
because the point of it is do checks that are agnostic of how the
paths were obtained.
This also makes `PathsByRole` cloneable, which is now possible
because it no longer holds on to a `std::io::Error` with its
non-cloneable dynamic error information, and adds some other
missing traits on test helper types.
0 commit comments