lance_core/utils/
path.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright The Lance Authors
3
4use object_store::path::Path;
5
6pub trait LancePathExt {
7    fn child_path(&self, path: &Path) -> Path;
8}
9
10impl LancePathExt for Path {
11    fn child_path(&self, path: &Path) -> Path {
12        let mut new_path = self.clone();
13        for part in path.parts() {
14            new_path = new_path.child(part);
15        }
16        new_path
17    }
18}