Skip to content

Commit da9864a

Browse files
committed
Reorganize IsSuccess implementations to be more composable
1 parent 2ce5e91 commit da9864a

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

ui/src/server_axum.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,31 @@ trait IsSuccess {
308308
fn is_success(&self) -> bool;
309309
}
310310

311-
impl IsSuccess for coordinator::WithOutput<coordinator::CompileResponse> {
311+
impl<T> IsSuccess for &T
312+
where
313+
T: IsSuccess,
314+
{
315+
fn is_success(&self) -> bool {
316+
T::is_success(self)
317+
}
318+
}
319+
320+
impl<T> IsSuccess for coordinator::WithOutput<T>
321+
where
322+
T: IsSuccess,
323+
{
324+
fn is_success(&self) -> bool {
325+
self.response.is_success()
326+
}
327+
}
328+
329+
impl IsSuccess for coordinator::CompileResponse {
312330
fn is_success(&self) -> bool {
313331
self.success
314332
}
315333
}
316334

317-
impl IsSuccess for coordinator::WithOutput<coordinator::ExecuteResponse> {
335+
impl IsSuccess for coordinator::ExecuteResponse {
318336
fn is_success(&self) -> bool {
319337
self.success
320338
}

0 commit comments

Comments
 (0)