From 6fe5d64b03b51fccea87ba462348943a33a3a5de Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Thu, 19 Jan 2023 11:27:01 +0000 Subject: Import macro directly rather than using #[macro_use]. `extern crate` makes it harder to keep track of dependencies, so we prefer to import macros explicitly instead. Bug: 261037227 Test: m example_service_fuzzer parcel_fuzzer_rs Test: atest libbinder_rs-internal_test libbinder_ndk_bindgen_test Change-Id: I6dbce8ee985d0a850ddddf8d08d5b330f5f13c9f --- libs/binder/rust/src/lib.rs | 4 +--- libs/binder/rust/tests/parcel_fuzzer/parcel_fuzzer.rs | 5 +---- .../parcel_fuzzer/random_parcel/fuzz_service_test/service_fuzzer.rs | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'libs') diff --git a/libs/binder/rust/src/lib.rs b/libs/binder/rust/src/lib.rs index a0e61d95f9..0c8b48f1f5 100644 --- a/libs/binder/rust/src/lib.rs +++ b/libs/binder/rust/src/lib.rs @@ -93,15 +93,13 @@ //! } //! ``` -#[macro_use] -mod proxy; - #[macro_use] mod binder; mod binder_async; mod error; mod native; mod parcel; +mod proxy; mod state; use binder_ndk_sys as sys; diff --git a/libs/binder/rust/tests/parcel_fuzzer/parcel_fuzzer.rs b/libs/binder/rust/tests/parcel_fuzzer/parcel_fuzzer.rs index c5c7719df2..29bf92cb97 100644 --- a/libs/binder/rust/tests/parcel_fuzzer/parcel_fuzzer.rs +++ b/libs/binder/rust/tests/parcel_fuzzer/parcel_fuzzer.rs @@ -17,9 +17,6 @@ #![allow(missing_docs)] #![no_main] -#[macro_use] -extern crate libfuzzer_sys; - mod read_utils; use crate::read_utils::READ_FUNCS; @@ -31,7 +28,7 @@ use binder::{ StatusCode, }; use binder_random_parcel_rs::create_random_parcel; -use libfuzzer_sys::arbitrary::Arbitrary; +use libfuzzer_sys::{arbitrary::Arbitrary, fuzz_target}; #[derive(Arbitrary, Debug)] enum ReadOperation { diff --git a/libs/binder/rust/tests/parcel_fuzzer/random_parcel/fuzz_service_test/service_fuzzer.rs b/libs/binder/rust/tests/parcel_fuzzer/random_parcel/fuzz_service_test/service_fuzzer.rs index a427f28e29..c53038210c 100644 --- a/libs/binder/rust/tests/parcel_fuzzer/random_parcel/fuzz_service_test/service_fuzzer.rs +++ b/libs/binder/rust/tests/parcel_fuzzer/random_parcel/fuzz_service_test/service_fuzzer.rs @@ -16,8 +16,8 @@ #![allow(missing_docs)] #![no_main] -#[macro_use] -extern crate libfuzzer_sys; + +use libfuzzer_sys::fuzz_target; use binder::{self, BinderFeatures, Interface}; use binder_random_parcel_rs::fuzz_service; -- cgit v1.2.3-59-g8ed1b