Skip to content

Commit

Permalink
Format Rust code using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 24, 2024
1 parent 303d247 commit 9fe524d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions crates/core/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ where
struct DefaultStatusOK;
#[async_trait]
impl Handler for DefaultStatusOK {
async fn handle(&self, _req: &mut Request, _depot: &mut Depot, res: &mut Response, _ctrl: &mut FlowCtrl) {
async fn handle(
&self,
_req: &mut Request,
_depot: &mut Depot,
res: &mut Response,
_ctrl: &mut FlowCtrl,
) {
if res.status_code.is_none() {
res.status_code = Some(StatusCode::OK);
}
Expand Down Expand Up @@ -222,7 +228,15 @@ impl HyperHandler {
// Set default status code before service hoops executed.
// We hope all hoops in service can get the correct status code.
let mut ctrl = if !hoops.is_empty() {
FlowCtrl::new([&hoops[..], &[Arc::new(DefaultStatusOK)], &dm.hoops[..], &[dm.goal]].concat())
FlowCtrl::new(
[
&hoops[..],
&[Arc::new(DefaultStatusOK)],
&dm.hoops[..],
&[dm.goal],
]
.concat(),
)
} else {
FlowCtrl::new([&dm.hoops[..], &[dm.goal]].concat())
};
Expand Down

0 comments on commit 9fe524d

Please sign in to comment.