From 355b9516c3c3bfe69208d33ecea7fed0acb20d17 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 19 Oct 2024 11:06:06 +0200 Subject: [PATCH] containers: add Suppl::with deterministic constructor --- Cargo.lock | 4 ++-- src/containers/suppl.rs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5000e05..a3fdd9ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,9 +307,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] diff --git a/src/containers/suppl.rs b/src/containers/suppl.rs index 5da0ea8b..a98aa3ed 100644 --- a/src/containers/suppl.rs +++ b/src/containers/suppl.rs @@ -221,6 +221,19 @@ impl Supplement { } } + pub fn with( + content: impl Into, + creator: impl Into, + timestamp: i64, + ) -> Self { + Supplement { + content_id: content.into(), + timestamp, + creator: creator.into(), + annotations: none!(), + } + } + pub fn get_default_opt( &self, sub: SupplSub,