Closed Property404 closed 1 year ago
This new method allows checking if a path is root without cloning or constructing anything.
Currently, I believe you have to do either:
path.as_str().is_empty()
path == path.root()
Arc
Previously, you could also do:
path.parent().is_none()
This new method allows checking if a path is root without cloning or constructing anything.
Currently, I believe you have to do either:
path.as_str().is_empty()
which is less semantically obvious and exposes the implementationpath == path.root()
which is a bit more expensive because cloning anArc
requires atomic operations.Previously, you could also do:
path.parent().is_none()
which had similar issues topath == path.root()