From 7d1d6efe38f92c5ee1535997a8355d1e37211cda Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Thu, 18 Apr 2019 14:59:06 +0200 Subject: [PATCH] fmt. --- src/memory.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/memory.rs b/src/memory.rs index f9d3cfc..22ff1b7 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -110,21 +110,16 @@ impl MemoryInstance { pub fn alloc(initial: Pages, maximum: Option) -> Result { { use std::convert::TryInto; - let initial_u32: u32 = initial - .0 - .try_into() - .map_err(|_| Error::Memory(format!("initial ({}) can't be coerced to u32", initial.0)))?; + let initial_u32: u32 = initial.0.try_into().map_err(|_| { + Error::Memory(format!("initial ({}) can't be coerced to u32", initial.0)) + })?; let maximum_u32: Option = match maximum { - Some(maximum_pages) => Some( - maximum_pages - .0 - .try_into() - .map_err(|_| - Error::Memory( - format!("maximum ({}) can't be coerced to u32", maximum_pages.0) - ) - )?, - ), + Some(maximum_pages) => Some(maximum_pages.0.try_into().map_err(|_| { + Error::Memory(format!( + "maximum ({}) can't be coerced to u32", + maximum_pages.0 + )) + })?), None => None, }; validation::validate_memory(initial_u32, maximum_u32).map_err(Error::Memory)?;