trello-to-deck/src/execute.rs
Paul Campbell 7af4dae96d
Some checks failed
Test / build (map[name:stable]) (push) Successful in 1m51s
Test / build (map[name:nightly]) (push) Successful in 2m4s
Release Please / Release-plz (push) Failing after 20s
refactor: Execute::execute passes itself by ref
2024-12-16 06:41:29 +00:00

21 lines
630 B
Rust

//
use color_eyre::eyre::eyre;
use color_eyre::Result;
use crate::FullCtx;
pub(crate) trait Execute {
async fn execute(&self, ctx: &FullCtx) -> Result<()>;
}
impl Execute for crate::Command {
async fn execute(&self, ctx: &FullCtx) -> Result<()> {
match self {
Self::Init => Err(eyre!("Config file already exists. Not overwriting it.")),
Self::Check => crate::check::run(ctx).await,
Self::Import => todo!(), //crate::import::run(ctx).await,
Self::Trello(cmd) => cmd.execute(ctx).await,
Self::Nextcloud(cmd) => cmd.execute(ctx).await,
}
}
}