Type-level assurance of path being serialized or not in Room::find_path
#61
Labels
C-enhancement
Category: A PR with an enhancement or a proposed on in an issue.
Room.findPath
returns either a serialized path or not depending on theserialized
parameter passed in.As of #53, we translate that to always returning a
Path
enum that can be serialized or not. While this works, it requires someone who only wants a non-serialized or only wants a serialized path to perform an unwrap on the result.Since we are using a builder pattern for
FindOptions
, it should be possible to know at compile time whether or not we're settingserialized
by having an additional type parameter for it.If we do this we can provide type-level assurance that a serialized path is or is not returned. Since we already have
Path
too, it could be a pure improvement since we could have three type options:Serialized
,Vectorized
andRuntimeDecided
returningVec<Step>
,String
andPath
respectively.See #53 (comment).
The text was updated successfully, but these errors were encountered: