Skip to content

Commit

Permalink
refactor: move metadata logic to construct time
Browse files Browse the repository at this point in the history
Signed-off-by: Lzzzt <[email protected]>
  • Loading branch information
Lzzzzzt committed Jul 16, 2024
1 parent 1a14b0b commit 460b1cd
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/src/layers/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,8 @@ impl<A: Access> LayeredAccess for CompleteAccessor<A> {
&self.inner
}

// Todo: May move the logic to the implement of Layer::layer of CompleteAccessor<A>
fn metadata(&self) -> Arc<AccessorInfo> {
let mut meta = self.meta.as_ref().clone();
let cap = meta.full_capability_mut();
if cap.list && cap.write_can_empty {
cap.create_dir = true;
}
meta.into()
self.meta.clone()
}

async fn create_dir(&self, path: &str, args: OpCreateDir) -> Result<RpCreateDir> {
Expand Down

0 comments on commit 460b1cd

Please sign in to comment.