From 4b5c3fbf207fe35d2fc63794191ce9201796b003 Mon Sep 17 00:00:00 2001 From: Lahfir Date: Thu, 16 Apr 2026 04:36:27 -0700 Subject: [PATCH] style: apply cargo fmt after c_abi_harness additions --- crates/ffi/src/apps/list.rs | 5 +---- crates/ffi/src/observation/is.rs | 5 ++++- crates/ffi/tests/c_abi_harness.rs | 12 +++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crates/ffi/src/apps/list.rs b/crates/ffi/src/apps/list.rs index bf95ff02..6c9f3f0c 100644 --- a/crates/ffi/src/apps/list.rs +++ b/crates/ffi/src/apps/list.rs @@ -52,10 +52,7 @@ pub unsafe extern "C" fn ad_app_list_count(list: *const AdAppList) -> u32 { /// # Safety /// `list` must be null or a pointer returned by `ad_list_apps`. #[no_mangle] -pub unsafe extern "C" fn ad_app_list_get( - list: *const AdAppList, - index: u32, -) -> *const AdAppInfo { +pub unsafe extern "C" fn ad_app_list_get(list: *const AdAppList, index: u32) -> *const AdAppInfo { if list.is_null() { return ptr::null(); } diff --git a/crates/ffi/src/observation/is.rs b/crates/ffi/src/observation/is.rs index 8bb1eff9..97b0c2f7 100644 --- a/crates/ffi/src/observation/is.rs +++ b/crates/ffi/src/observation/is.rs @@ -108,7 +108,10 @@ pub unsafe extern "C" fn ad_is( } fn is_known_property(p: &str) -> bool { - matches!(p, "focused" | "enabled" | "selected" | "checked" | "expanded") + matches!( + p, + "focused" | "enabled" | "selected" | "checked" | "expanded" + ) } fn element_has_state(node: &AccessibilityNode, prop: &str) -> bool { diff --git a/crates/ffi/tests/c_abi_harness.rs b/crates/ffi/tests/c_abi_harness.rs index eee17b48..66e9ae54 100644 --- a/crates/ffi/tests/c_abi_harness.rs +++ b/crates/ffi/tests/c_abi_harness.rs @@ -141,7 +141,9 @@ fn enum_fuzz_invalid_discriminant_rejected() { action.drag = default_drag(); action.text = std::ptr::null(); - let handle = AdNativeHandle { ptr: std::ptr::null() }; + let handle = AdNativeHandle { + ptr: std::ptr::null(), + }; let mut out: AdActionResult = std::mem::zeroed(); let rc = ad_execute_action(adapter, &handle, &action, &mut out); // Either the enum validator rejects (expected) or the cargo-test @@ -227,7 +229,9 @@ fn find_returns_not_found_on_empty_query_against_no_window() { name_substring: std::ptr::null(), value_substring: std::ptr::null(), }; - let mut handle = AdNativeHandle { ptr: std::ptr::null() }; + let mut handle = AdNativeHandle { + ptr: std::ptr::null(), + }; let rc = ad_find(adapter, &bad_win, &query, &mut handle); // A zeroed window has null id/title → InvalidArgs. On cargo-test // worker threads the main-thread assert trips first and returns @@ -244,7 +248,9 @@ fn find_returns_not_found_on_empty_query_against_no_window() { #[test] fn free_handle_null_is_noop() { with_adapter(|adapter| unsafe { - let handle = AdNativeHandle { ptr: std::ptr::null() }; + let handle = AdNativeHandle { + ptr: std::ptr::null(), + }; let rc = ad_free_handle(adapter, &handle); assert_eq!(rc, AdResult::Ok);