Skip to content

Commit

Permalink
refactor: tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
tmtmtoo committed Jan 5, 2024
1 parent 7ef2660 commit 34cafd1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/components/cmd_executor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::exec::*;
use crate::app::*;

#[derive(new)]
pub struct CmdExecutor {
Expand All @@ -7,7 +8,7 @@ pub struct CmdExecutor {
}

#[async_trait::async_trait]
impl crate::app::Component for CmdExecutor {
impl Component for CmdExecutor {
type Output = anyhow::Result<Exit>;

async fn handle(&self) -> Self::Output {
Expand Down
6 changes: 4 additions & 2 deletions src/app/components/cmd_not_found.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use crate::app::*;

#[derive(new)]
pub struct PrintableCmdNotFound<C> {
pub command: String,
pub inner: C,
}

#[async_trait::async_trait]
impl<T: 'static, C: crate::app::Component<Output = anyhow::Result<T>> + Send + Sync>
crate::app::Component for PrintableCmdNotFound<C>
impl<T: 'static, C: Component<Output = anyhow::Result<T>> + Send + Sync>
Component for PrintableCmdNotFound<C>
{
type Output = anyhow::Result<T>;

Expand Down
4 changes: 3 additions & 1 deletion src/app/components/wait.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use crate::app::*;

pub struct WaitSec {
pub sec: f64,
}

#[async_trait::async_trait]
impl crate::app::Component for WaitSec {
impl Component for WaitSec {
type Output = ();

async fn handle(&self) -> Self::Output {
Expand Down

0 comments on commit 34cafd1

Please sign in to comment.