Skip to content

Commit

Permalink
Refactor error formatting and clean up syntax
Browse files Browse the repository at this point in the history
Changed the 'IntoResult' implementation for `Result` to use 'Debug' for error formatting instead of 'Display'. This provides more detailed error information which can be useful for debugging. Also, cleaned up some syntax in the `routine` match statement for better readability.
  • Loading branch information
Barsik-sus committed Mar 12, 2024
1 parent d417f78 commit 96d78f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/move/wca/src/ca/executor/routine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ pub( crate ) mod private

impl IntoResult for std::convert::Infallible { fn into_result( self ) -> Result< () > { Ok( () ) } }
impl IntoResult for () { fn into_result( self ) -> Result< () > { Ok( () ) } }
impl< E : std::fmt::Display > IntoResult for Result< (), E > { fn into_result( self ) -> Result< () > { self.map_err( | e | anyhow!( "{e}" )) } }
impl< E : std::fmt::Debug > IntoResult for Result< (), E > { fn into_result( self ) -> Result< () > { self.map_err( | e | anyhow!( "{e:?}" )) } }
}

//
Expand Down
2 changes: 1 addition & 1 deletion module/move/wca/src/ca/executor/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub( crate ) mod private
{
match routine
{
Routine::WithoutContext( routine ) => routine( ( Args( command.subjects ), Props( command.properties ) )),
Routine::WithoutContext( routine ) => routine(( Args( command.subjects ), Props( command.properties ) )),
Routine::WithContext( routine ) => routine( ( Args( command.subjects ), Props( command.properties ) ), ctx ),
}
}
Expand Down

0 comments on commit 96d78f3

Please sign in to comment.