From 3cbba4166567e37d48a92652249476b4431759b6 Mon Sep 17 00:00:00 2001 From: Francois Hardrouyere Date: Wed, 1 May 2024 13:10:51 +0200 Subject: [PATCH] cargo fmt --- x/programs/rust/wasmlanche-sdk/src/params.rs | 4 +--- x/programs/rust/wasmlanche-sdk/src/program.rs | 13 +++++++++++-- x/programs/rust/wasmlanche-sdk/src/state.rs | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/x/programs/rust/wasmlanche-sdk/src/params.rs b/x/programs/rust/wasmlanche-sdk/src/params.rs index fed5b57d8d..daa9775753 100644 --- a/x/programs/rust/wasmlanche-sdk/src/params.rs +++ b/x/programs/rust/wasmlanche-sdk/src/params.rs @@ -1,6 +1,4 @@ -use crate::{ - memory::to_ffi_ptr, program::CPointer, state::Error as StateError, Error -}; +use crate::{memory::to_ffi_ptr, program::CPointer, state::Error as StateError, Error}; use borsh::BorshSerialize; #[macro_export] diff --git a/x/programs/rust/wasmlanche-sdk/src/program.rs b/x/programs/rust/wasmlanche-sdk/src/program.rs index 7f7e5f2a0d..37455fcbaf 100644 --- a/x/programs/rust/wasmlanche-sdk/src/program.rs +++ b/x/programs/rust/wasmlanche-sdk/src/program.rs @@ -2,7 +2,11 @@ use std::hash::Hash; use borsh::{BorshDeserialize, BorshSerialize}; -use crate::{memory::to_ffi_ptr, state::{Error as StateError, State, Key}, Params}; +use crate::{ + memory::to_ffi_ptr, + state::{Error as StateError, Key, State}, + Params, +}; /// Represents the current Program in the context of the caller. Or an external /// program that is being invoked. @@ -61,5 +65,10 @@ pub struct CPointer(pub *const u8, pub usize); #[link(wasm_import_module = "program")] extern "C" { #[link_name = "call_program"] - fn _call_program(target_id: CPointer, function: CPointer, args_ptr: CPointer, max_units: i64) -> i64; + fn _call_program( + target_id: CPointer, + function: CPointer, + args_ptr: CPointer, + max_units: i64, + ) -> i64; } diff --git a/x/programs/rust/wasmlanche-sdk/src/state.rs b/x/programs/rust/wasmlanche-sdk/src/state.rs index 4d8d68eefe..eae20814b0 100644 --- a/x/programs/rust/wasmlanche-sdk/src/state.rs +++ b/x/programs/rust/wasmlanche-sdk/src/state.rs @@ -221,7 +221,7 @@ mod host { args = (caller, key, value) } { 0 => Ok(()), - _ => Err(Error::Write) + _ => Err(Error::Write), } } @@ -242,7 +242,7 @@ mod host { args = (caller, key) } { 0 => Ok(()), - _ => Err(Error::Delete) + _ => Err(Error::Delete), } } }