Skip to content

Commit 30fd2b6

Browse files
committed
add try_get_commit to PersistentHugr
1 parent 3adb23c commit 30fd2b6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hugr-persistent/src/persistent_hugr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ impl<R> PersistentHugr<R> {
454454
pub fn base_commit(&self) -> &Commit;
455455
/// Get the commit with ID `commit_id`.
456456
pub fn get_commit(&self, commit_id: CommitId) -> &Commit;
457+
/// Check whether `commit_id` exists and return it.
458+
pub fn try_get_commit(&self, commit_id: CommitId) -> Option<&Commit>;
457459
/// Get an iterator over all nodes inserted by `commit_id`.
458460
///
459461
/// All nodes will be PatchNodes with commit ID `commit_id`.

0 commit comments

Comments
 (0)