Skip to content

Commit

Permalink
refactor: get rid of uncecessary clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
playX18 committed Oct 22, 2024
1 parent 3099817 commit a85e2b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
7 changes: 6 additions & 1 deletion gstd/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ pub mod collections {
///
/// [`alloc::ffi`]: ::alloc::ffi
pub mod ffi {
pub use ::alloc::ffi::*;
pub use ::alloc::ffi::{
FromVecWithNulError,
IntoStringError,
NulError,
CString
};
pub use core::ffi::*;
}

Expand Down
7 changes: 3 additions & 4 deletions runtime-interface/sandbox/src/detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ struct SupervisorContext<'a, 'b> {
}

impl<'a, 'b> sandbox_env::SupervisorContext for SupervisorContext<'a, 'b> {
#[allow(clippy::needless_borrows_for_generic_args)]
fn invoke(
&mut self,
invoke_args_ptr: Pointer<u8>,
Expand All @@ -88,7 +87,7 @@ impl<'a, 'b> sandbox_env::SupervisorContext for SupervisorContext<'a, 'b> {
) -> gear_sandbox_host::error::Result<i64> {
let mut ret_vals = [Val::null()];
let result = self.dispatch_thunk.call(
&mut self.caller,
&mut *self.caller,
&[
Val::I32(u32::from(invoke_args_ptr) as i32),
Val::I32(invoke_args_len as i32),
Expand Down Expand Up @@ -485,7 +484,7 @@ pub fn memory_new(context: &mut dyn FunctionContext, initial: u32, maximum: u32)
method_result
}

#[allow(clippy::needless_borrows_for_generic_args)]

pub fn memory_set(
context: &mut dyn FunctionContext,
memory_idx: u32,
Expand All @@ -500,7 +499,7 @@ pub fn memory_set(
sp_wasm_interface::with_caller_mut(context, |caller| {
trace("memory_set", caller);

let Ok(buffer) = read_memory(&caller, val_ptr, val_len) else {
let Ok(buffer) = read_memory(&mut* caller, val_ptr, val_len) else {
method_result = sandbox_env::env::ERR_OUT_OF_BOUNDS;
return;
};
Expand Down
1 change: 0 additions & 1 deletion utils/gring/src/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ impl Keyring {
}

/// Update and get the primary key.
#[allow(clippy::assigning_clones)]
pub fn primary(&mut self) -> Result<Keystore> {
if self.ring.is_empty() {
return Err(anyhow!(
Expand Down
1 change: 0 additions & 1 deletion utils/gring/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ impl Keystore {
}

/// Returns self with the given name in meta.
#[allow(clippy::assigning_clones)]
pub fn with_name(mut self, name: &str) -> Self {
self.meta.name = name.to_owned();
self
Expand Down

0 comments on commit a85e2b0

Please sign in to comment.