Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef-Mak committed Oct 18, 2023
1 parent f478adf commit 945ea3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ext/src/ruby_api/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a> Global<'a> {
mutability: Mutability,
) -> Result<Self, Error> {
let wasm_type = value_type.to_val_type()?;
let wasm_default = default.to_wasm_val(wasm_type.clone())?;
let wasm_default = default.to_wasm_val(wasm_type)?;
let inner = GlobalImpl::new(
s.context_mut(),
GlobalType::new(wasm_type, mutability),
Expand Down Expand Up @@ -95,7 +95,7 @@ impl<'a> Global<'a> {
/// @def type
/// @return [Symbol] The Wasm type of the global‘s content.
pub fn type_(&self) -> Result<Symbol, Error> {
self.ty().map(|ty| ty.content().clone().to_sym())
self.ty().map(|ty| (*ty.content()).to_sym())
}

/// @yard
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<'a> Global<'a> {
}

fn value_type(&self) -> Result<wasmtime::ValType, Error> {
self.ty().map(|ty| ty.content().clone())
self.ty().map(|ty| *ty.content())
}

fn retain_non_nil_extern_ref(&self, value: Value) -> Result<(), Error> {
Expand Down
2 changes: 1 addition & 1 deletion ext/src/ruby_api/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Param {

fn to_wasmtime_val(&self) -> Result<wasmtime::Val, Error> {
self.val
.to_wasm_val(self.ty.clone())
.to_wasm_val(self.ty)
.map_err(|error| match error.error_type() {
ErrorType::Error(class, msg) => {
Error::new(*class, format!("{} (param at index {})", msg, self.index))
Expand Down
2 changes: 1 addition & 1 deletion ext/src/ruby_api/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a> Table<'a> {
let (min,) = kw.required;
let (max,) = kw.optional;
let wasm_type = value_type.to_val_type()?;
let wasm_default = default.to_wasm_val(wasm_type.clone())?;
let wasm_default = default.to_wasm_val(wasm_type)?;

let inner = TableImpl::new(
s.context_mut(),
Expand Down

0 comments on commit 945ea3c

Please sign in to comment.