lance_core/utils/
path.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Lance Authors

use object_store::path::Path;

pub trait LancePathExt {
    fn child_path(&self, path: &Path) -> Path;
}

impl LancePathExt for Path {
    fn child_path(&self, path: &Path) -> Path {
        let mut new_path = self.clone();
        for part in path.parts() {
            new_path = path.child(part);
        }
        new_path
    }
}