tustvold commented on code in PR #4203:
URL: https://github.com/apache/arrow-rs/pull/4203#discussion_r1191255897


##########
object_store/src/prefix.rs:
##########
@@ -59,36 +56,63 @@ impl<T: ObjectStore> PrefixStore<T> {
     }
 
     /// Strip the constant prefix from a given path
-    fn strip_prefix(&self, path: &Path) -> Option<Path> {
-        Some(path.prefix_match(&self.prefix)?.collect())
+    fn strip_prefix(&self, path: Path) -> Path {
+        // Note cannot use match because of borrow checker
+        if let Some(suffix) = path.prefix_match(&self.prefix) {
+            return suffix.collect();
+        }
+        path
+    }
+
+    /// Strip the constant prefix from a given ObjectMeta
+    fn strip_meta(&self, meta: ObjectMeta) -> ObjectMeta {
+        ObjectMeta {
+            last_modified: meta.last_modified,
+            size: meta.size,
+            location: self.strip_prefix(meta.location),
+            e_tag: meta.e_tag,
+        }
     }
 }
 
 #[async_trait::async_trait]
 impl<T: ObjectStore> ObjectStore for PrefixStore<T> {
-    async fn put(&self, location: &Path, bytes: Bytes) -> 
ObjectStoreResult<()> {
+    async fn put(&self, location: &Path, bytes: Bytes) -> Result<()> {
         let full_path = self.full_path(location);
         self.inner.put(&full_path, bytes).await
     }
 
+    async fn put_multipart(

Review Comment:
   These are re-ordered to match the impl order of the trait



-- 
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]

Reply via email to