Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 2481eff

Browse files
Natfiiclaude
andcommitted
style(ffi): apply rustfmt to new test code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d17f1c1 commit 2481eff

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

zeroclaw-android/zeroclaw-ffi/src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,15 +1590,14 @@ mod tests {
15901590

15911591
#[test]
15921592
fn test_catch_unwind_returns_internal_panic() {
1593-
let result: Result<(), FfiError> =
1594-
std::panic::catch_unwind(|| -> Result<(), FfiError> {
1595-
panic!("test panic for FFI boundary");
1593+
let result: Result<(), FfiError> = std::panic::catch_unwind(|| -> Result<(), FfiError> {
1594+
panic!("test panic for FFI boundary");
1595+
})
1596+
.unwrap_or_else(|e| {
1597+
Err(FfiError::InternalPanic {
1598+
detail: panic_detail(&e),
15961599
})
1597-
.unwrap_or_else(|e| {
1598-
Err(FfiError::InternalPanic {
1599-
detail: panic_detail(&e),
1600-
})
1601-
});
1600+
});
16021601
match result.unwrap_err() {
16031602
FfiError::InternalPanic { detail } => {
16041603
assert!(detail.contains("test panic for FFI boundary"));

zeroclaw-android/zeroclaw-ffi/src/session.rs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,19 +2887,18 @@ mod tests {
28872887
});
28882888
}
28892889

2890-
let _panic_result =
2891-
std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
2892-
let (history, tools) = {
2893-
let mut guard = lock_session();
2894-
let session = guard.as_mut().unwrap();
2895-
(
2896-
std::mem::take(&mut session.history),
2897-
std::mem::take(&mut session.tools_registry),
2898-
)
2899-
};
2900-
let _state_guard = SessionStateGuard::new(history, tools);
2901-
panic!("simulated unwind");
2902-
}));
2890+
let _panic_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
2891+
let (history, tools) = {
2892+
let mut guard = lock_session();
2893+
let session = guard.as_mut().unwrap();
2894+
(
2895+
std::mem::take(&mut session.history),
2896+
std::mem::take(&mut session.tools_registry),
2897+
)
2898+
};
2899+
let _state_guard = SessionStateGuard::new(history, tools);
2900+
panic!("simulated unwind");
2901+
}));
29032902

29042903
{
29052904
let guard = lock_session();
@@ -2912,11 +2911,10 @@ mod tests {
29122911

29132912
#[test]
29142913
fn test_poisoned_cancel_token_recovery() {
2915-
let _panic_result =
2916-
std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
2917-
let _guard = CANCEL_TOKEN.lock().unwrap();
2918-
panic!("poison the mutex");
2919-
}));
2914+
let _panic_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
2915+
let _guard = CANCEL_TOKEN.lock().unwrap();
2916+
panic!("poison the mutex");
2917+
}));
29202918

29212919
let mut guard = lock_cancel_token();
29222920
*guard = Some(CancellationToken::new());

0 commit comments

Comments
 (0)