Skip to content

Commit

Permalink
containers: add Suppl::with deterministic constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 19, 2024
1 parent ee649c6 commit 355b951
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/containers/suppl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ impl Supplement {
}
}

pub fn with(
content: impl Into<ContentRef>,
creator: impl Into<Identity>,
timestamp: i64,
) -> Self {
Supplement {
content_id: content.into(),
timestamp,
creator: creator.into(),
annotations: none!(),
}
}

pub fn get_default_opt<T: StrictDeserialize>(
&self,
sub: SupplSub,
Expand Down

0 comments on commit 355b951

Please sign in to comment.