From 509f767b1f6d4797d8f218fb02ad201a6ae3d358 Mon Sep 17 00:00:00 2001 From: Akulij Date: Thu, 1 May 2025 14:53:14 +0300 Subject: [PATCH] create CallbackInfo.new_with_literal method reason: CallbackInfo with literal and without created in completly differrent usecases, so it will be easier to code with differrent functions instead of passing Option each time --- src/db/callback_info.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/db/callback_info.rs b/src/db/callback_info.rs index 39497e6..1ad074b 100644 --- a/src/db/callback_info.rs +++ b/src/db/callback_info.rs @@ -34,6 +34,15 @@ where } } + pub fn new_with_literal(callback: C, literal: String) -> Self { + Self { + _id: Default::default(), + created_at: Local::now().into(), + literal: Some(literal), + callback, + } + } + pub fn get_id(&self) -> String { self._id.to_hex() }