From 016f4e2f49bfe6fd1bff738e31434c97ef754223 Mon Sep 17 00:00:00 2001 From: tanyanying Date: Thu, 23 Mar 2023 07:26:56 +0000 Subject: [PATCH] style: Modify the format to remove extra spaces Signed-off-by: tanyanying --- example/rust_test/service/src/lib.rs | 2 +- interfaces/innerkits/rust/src/ashmem.rs | 2 +- .../innerkits/rust/src/ipc/remote_obj/death_recipient.rs | 2 +- interfaces/innerkits/rust/src/ipc/remote_stub.rs | 2 +- interfaces/innerkits/rust/src/process.rs | 6 +++--- ipc/native/test/unittest/rust/service/src/lib.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/rust_test/service/src/lib.rs b/example/rust_test/service/src/lib.rs index 548a677..ad49d24 100644 --- a/example/rust_test/service/src/lib.rs +++ b/example/rust_test/service/src/lib.rs @@ -83,7 +83,7 @@ impl TryFrom for ICalcCode { } } -/// Function between proxy and stub of ICalcService +/// Function between proxy and stub of ICalcService pub trait ICalc: IRemoteBroker { /// Calc add num1 + num2 fn add(&self, num1: i32, num2: i32) -> IpcResult; diff --git a/interfaces/innerkits/rust/src/ashmem.rs b/interfaces/innerkits/rust/src/ashmem.rs index bacefa0..2a270e6 100644 --- a/interfaces/innerkits/rust/src/ashmem.rs +++ b/interfaces/innerkits/rust/src/ashmem.rs @@ -161,7 +161,7 @@ impl Ashmem { // SAFETY: Rust Ashmem always hold a valid native CAshmem. ipc_binding::ReadFromCAshmem(self.as_inner(), size, offset) }; - if raw_ptr.is_null() { + if raw_ptr.is_null() { Err(IpcStatusCode::Failed) } else { Ok(RawData::new(raw_ptr, size as u32)) diff --git a/interfaces/innerkits/rust/src/ipc/remote_obj/death_recipient.rs b/interfaces/innerkits/rust/src/ipc/remote_obj/death_recipient.rs index afbb307..0febc8c 100644 --- a/interfaces/innerkits/rust/src/ipc/remote_obj/death_recipient.rs +++ b/interfaces/innerkits/rust/src/ipc/remote_obj/death_recipient.rs @@ -23,7 +23,7 @@ const LOG_LABEL: HiLogLabel = HiLogLabel { tag: "RustDeathRecipient" }; -/// This type represent a rust DeathRecipient which like C++ DethRecipient. +/// This type represent a rust DeathRecipient which like C++ DethRecipient. #[repr(C)] pub struct DeathRecipient { native: *mut CDeathRecipient, diff --git a/interfaces/innerkits/rust/src/ipc/remote_stub.rs b/interfaces/innerkits/rust/src/ipc/remote_stub.rs index 96a1587..760eef1 100644 --- a/interfaces/innerkits/rust/src/ipc/remote_stub.rs +++ b/interfaces/innerkits/rust/src/ipc/remote_stub.rs @@ -13,7 +13,7 @@ * limitations under the License. */ -use crate::{ipc_binding, IRemoteStub, IRemoteBroker, RemoteObj, BorrowedMsgParcel, }; +use crate::{ipc_binding, IRemoteStub, IRemoteBroker, RemoteObj, BorrowedMsgParcel}; use crate::ipc_binding::{CRemoteObject, CParcel}; use std::ffi::{c_void, CString, c_char}; use std::ops::{Deref}; diff --git a/interfaces/innerkits/rust/src/process.rs b/interfaces/innerkits/rust/src/process.rs index 228c06e..501392d 100644 --- a/interfaces/innerkits/rust/src/process.rs +++ b/interfaces/innerkits/rust/src/process.rs @@ -17,7 +17,7 @@ use crate::{ ipc_binding, MsgParcel, RemoteObj, IRemoteObj, InterfaceToken, String16, IpcResult, IpcStatusCode, parse_status_code, }; -use crate::parcel::{vec_to_string, allocate_vec_with_buffer,}; +use crate::parcel::{vec_to_string, allocate_vec_with_buffer}; use std::ffi::{CString, c_char, c_void}; use hilog_rust::{info, hilog, HiLogLabel, LogType}; @@ -164,7 +164,7 @@ pub fn set_calling_identity(identity: String) -> bool /// get local device id #[inline] -pub fn get_local_device_id() -> IpcResult +pub fn get_local_device_id() -> IpcResult { let mut vec: Option> = None; let ok_status = unsafe { @@ -204,7 +204,7 @@ pub fn get_calling_device_id() -> IpcResult /// reset calling identity #[inline] -pub fn reset_calling_identity() -> IpcResult +pub fn reset_calling_identity() -> IpcResult { let mut vec: Option> = None; let ok_status = unsafe { diff --git a/ipc/native/test/unittest/rust/service/src/lib.rs b/ipc/native/test/unittest/rust/service/src/lib.rs index 6ca607d..f1950bf 100644 --- a/ipc/native/test/unittest/rust/service/src/lib.rs +++ b/ipc/native/test/unittest/rust/service/src/lib.rs @@ -84,7 +84,7 @@ impl TryFrom for ITestCode { } } -/// Function between proxy and stub of ITestService +/// Function between proxy and stub of ITestService pub trait ITest: IRemoteBroker { /// Test sync transaction fn test_sync_transaction(&self, value: i32, delay_time: i32) -> IpcResult; -- GitLab