Run rustfmt

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-10-20 16:21:50 -07:00
parent ceda48988d
commit 692bb521ec
27 changed files with 402 additions and 251 deletions

View File

@@ -1,6 +1,6 @@
use crate::{obj::prelude::*, vm::inst::Inst};
use std::fmt::{self, Debug, Formatter};
use std::{collections::BTreeMap, sync::Arc};
use std::fmt::{self, Formatter, Debug};
pub type FrameBindings = BTreeMap<usize, ObjRef>;
@@ -53,8 +53,18 @@ pub struct UserFrame {
}
impl UserFrame {
pub fn new(callee: ObjRef, bindings: FrameBindings, last_pc: usize, code: Arc<Vec<Inst>>) -> Self {
Self { callee, bindings, last_pc, code, }
pub fn new(
callee: ObjRef,
bindings: FrameBindings,
last_pc: usize,
code: Arc<Vec<Inst>>,
) -> Self {
Self {
callee,
bindings,
last_pc,
code,
}
}
pub fn bindings(&self) -> &FrameBindings {
@@ -86,7 +96,11 @@ pub struct NativeFrame {
impl NativeFrame {
pub fn new(callee: ObjRef, fun_ptr: NativeFunPtr, args: Vec<ObjRef>) -> Self {
Self { callee, fun_ptr, args }
Self {
callee,
fun_ptr,
args,
}
}
pub fn fun_ptr(&self) -> &NativeFunPtr {
@@ -105,7 +119,10 @@ impl NativeFrame {
impl Debug for NativeFrame {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
fmt.debug_struct("NativeFrame")
.field("fun_ptr", &format!("{:#x}", &self.fun_ptr as *const _ as usize))
.field(
"fun_ptr",
&format!("{:#x}", &self.fun_ptr as *const _ as usize),
)
.finish()
}
}