From 83c95d26e4673d20b909a2a7586102160ea94ce4 Mon Sep 17 00:00:00 2001 From: Nimpruda <7427905+Nimpruda@users.noreply.github.com> Date: Thu, 21 Oct 2021 21:26:50 +0200 Subject: [PATCH] rustfmt dat sh*t --- boa/src/builtins/dataview/mod.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/boa/src/builtins/dataview/mod.rs b/boa/src/builtins/dataview/mod.rs index 57e94b75c1d..c9832012d55 100644 --- a/boa/src/builtins/dataview/mod.rs +++ b/boa/src/builtins/dataview/mod.rs @@ -118,7 +118,7 @@ impl DataView { let buffer = buffer_borrow .as_array_buffer() .ok_or_else(|| context.construct_type_error("buffer must be an ArrayBuffer"))?; - + // 3. Let offset be ? ToIndex(byteOffset). let offset = args.get_or_undefined(1).to_index(context)?; // 4. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. @@ -155,10 +155,11 @@ impl DataView { // 10. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. if buffer_obj - .borrow() - .as_array_buffer() - .ok_or_else(|| context.construct_type_error("buffer must be an ArrayBuffer"))? - .is_detached_buffer() { + .borrow() + .as_array_buffer() + .ok_or_else(|| context.construct_type_error("buffer must be an ArrayBuffer"))? + .is_detached_buffer() + { return context.throw_type_error("ArrayBuffer can't be detached"); } @@ -195,11 +196,11 @@ impl DataView { ) -> JsResult { // 1. Let O be the this value. // 2. Perform ? RequireInternalSlot(O, [[DataView]]). - let dataview = this.as_object().map(|obj| obj.borrow()); + let dataview = this.as_object().map(|obj| obj.borrow()); let dataview = dataview - .as_ref() - .and_then(|obj| obj.as_data_view()) - .ok_or_else(|| context.construct_type_error("`this` is not a DataView"))?; + .as_ref() + .and_then(|obj| obj.as_data_view()) + .ok_or_else(|| context.construct_type_error("`this` is not a DataView"))?; // 3. Assert: O has a [[ViewedArrayBuffer]] internal slot. // 4. Let buffer be O.[[ViewedArrayBuffer]]. let buffer = dataview.viewed_array_buffer.clone();