Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan committed Aug 21, 2024
1 parent 3b22712 commit 8323c3f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions integrations/dav-server/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,33 @@
// specific language governing permissions and limitations
// under the License.

use super::metadata::OpendalMetaData;
use super::utils::*;
use dav_server::fs::{DavDirEntry, DavMetaData, FsResult};
use futures::StreamExt;
use futures::{FutureExt, Stream};
use opendal::raw::normalize_path;
use opendal::Operator;
use opendal::{Entry, Lister};
use std::pin::Pin;
use std::task::Poll::Ready;
use std::task::{ready, Context, Poll};
use opendal::raw::normalize_path;
use super::metadata::OpendalMetaData;
use super::utils::*;

/// OpendalStream is a stream of `DavDirEntry` that is used to list the contents of a directory.
pub struct OpendalStream {
op: Operator,
lister: Lister,
path: String
path: String,
}

impl OpendalStream {
/// Create a new opendal stream.
pub fn new(op: Operator, lister: Lister, p: &str) -> Self {
OpendalStream { op, lister, path: normalize_path(p)}
OpendalStream {
op,
lister,
path: normalize_path(p),
}
}
}

Expand All @@ -54,7 +58,7 @@ impl Stream for OpendalStream {
continue;
}
let webdav_entry = OpendalDirEntry::new(dav_stream.op.clone(), entry);
return Ready(Some(Ok(Box::new(webdav_entry) as Box<dyn DavDirEntry>)))
return Ready(Some(Ok(Box::new(webdav_entry) as Box<dyn DavDirEntry>)));
}
None => return Ready(None),
}
Expand Down

0 comments on commit 8323c3f

Please sign in to comment.