Young-Flash commented on code in PR #2879:
URL: 
https://github.com/apache/incubator-opendal/pull/2879#discussion_r1299183345


##########
bin/oay/src/services/webdav/webdav_dir_entry.rs:
##########
@@ -35,8 +36,10 @@ impl DavDirEntry for WebDAVDirEntry {
 
     fn metadata(&self) -> dav_server::fs::FsFuture<Box<dyn 
dav_server::fs::DavMetaData>> {
         async move {
-            let metedata = self.op.stat(self.dir_entry.path()).await.unwrap();
-            Ok(Box::new(WebdavMetaData::new(metedata)) as Box<dyn DavMetaData>)
+            self.op.stat(self.dir_entry.path()).await.map_or_else(

Review Comment:
   So is it like this?
   ```rust
   fn metadata(&self) -> dav_server::fs::FsFuture<Box<dyn 
dav_server::fs::DavMetaData>> {
       async move {
           self.op
               .stat(self.dir_entry.path())
               .await
               .map(|metadata| {
                   Box::new(WebdavMetaData::new(metadata)) as Box<dyn 
dav_server::fs::DavMetaData>
               })
               .map_err(convert_error)
       }
       .boxed()
   }
   ```



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