Skip to content

Commit

Permalink
qfix
Browse files Browse the repository at this point in the history
  • Loading branch information
fominok committed May 16, 2024
1 parent 478cdaa commit 8982308
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/grovedb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
Expand All @@ -30,6 +32,9 @@ jobs:
with:
cache-on-failure: "false"

- name: Setup Trunk
uses: jetli/[email protected]

- run: cargo test --workspace --all-features


Expand Down
5 changes: 5 additions & 0 deletions path/src/subtree_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ impl<B> SubtreePath<'_, B> {
SubtreePathInner::SubtreePathIter(path_iter) => path_iter.len(),
}
}

/// Returns whether the path is empty (the root tree).
pub fn is_empty(&self) -> bool {
self.len() == 0
}
}

impl<'b, B: AsRef<[u8]>> SubtreePath<'b, B> {
Expand Down
5 changes: 5 additions & 0 deletions path/src/subtree_path_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ impl<B> SubtreePathBuilder<'_, B> {
pub fn len(&self) -> usize {
self.base.len() + self.relative.len()
}

/// Returns whether the path is empty (the root tree).
pub fn is_empty(&self) -> bool {
self.len() == 0
}
}

impl<'b, B: AsRef<[u8]>> SubtreePathBuilder<'b, B> {
Expand Down

0 comments on commit 8982308

Please sign in to comment.