feat: move match scrutinee

This commit is contained in:
Max batleforc 2024-06-24 18:41:21 +02:00
parent bfd5596993
commit 2fd1201615
No known key found for this signature in database
GPG Key ID: 25D243AB4B6AC9E7

View File

@ -71,10 +71,11 @@ impl ScheduleJob {
#[instrument(skip(self))] #[instrument(skip(self))]
pub async fn add_cron_job(&mut self, server_id: u64, channel_id: u64, cron_expression: String) { pub async fn add_cron_job(&mut self, server_id: u64, channel_id: u64, cron_expression: String) {
let job = match Job::new(cron_expression.as_str(), move |uuid, _l| { let job_fn = move |uuid, _l| {
// Do something // Do something
info!("Cron job executed with id: {:?}", uuid); info!("Cron job executed with id: {:?}", uuid);
}) { };
let job = match Job::new(cron_expression.as_str(), job_fn) {
Ok(job) => job, Ok(job) => job,
Err(e) => { Err(e) => {
error!("Error creating cron job: {:?}", e); error!("Error creating cron job: {:?}", e);