Skip to content

Commit

Permalink
refactor(gstd,utils,runtime-interface): get rid of uncecessary clippy…
Browse files Browse the repository at this point in the history
… lints (#4305)

Co-authored-by: StackOverflowExcept1on <[email protected]>
  • Loading branch information
playX18 and StackOverflowExcept1on authored Oct 23, 2024
1 parent 6d8f5d4 commit 40ae438
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gstd/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub mod collections {
///
/// [`alloc::ffi`]: ::alloc::ffi
pub mod ffi {
pub use ::alloc::ffi::*;
pub use ::alloc::ffi::{CString, FromVecWithNulError, IntoStringError, NulError};
pub use core::ffi::*;
}

Expand Down
6 changes: 2 additions & 4 deletions runtime-interface/sandbox/src/detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 @@ -82,7 +81,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 @@ -479,7 +478,6 @@ 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 @@ -494,7 +492,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 40ae438

Please sign in to comment.