Kinrany commented on code in PR #546:
URL:
https://github.com/apache/arrow-rs-object-store/pull/546#discussion_r2551155363
##########
src/path/mod.rs:
##########
@@ -255,14 +262,39 @@ impl Path {
Self::parse(decoded)
}
- /// Returns the [`PathPart`] of this [`Path`]
- pub fn parts(&self) -> impl Iterator<Item = PathPart<'_>> {
- self.raw
- .split_terminator(DELIMITER)
- .map(|s| PathPart { raw: s.into() })
+ /// Returns the number of [`PathPart`]s in this [`Path`]
+ ///
+ /// # Performance
+ ///
+ /// This operation is `O(n)`, similar to calling `.parts().count()`
manually.
+ pub fn len(&self) -> usize {
Review Comment:
Would renaming `empty` and `is_empty` into `root` and `is_root` make sense?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]