tustvold commented on code in PR #546:
URL:
https://github.com/apache/arrow-rs-object-store/pull/546#discussion_r2541497644
##########
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:
This collides with the existing len provided by the deref to str
Edit: actually we don't implement deref but still callings this parts_count
or something might be less ambiguous
--
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]