From c1906bfd8451737bc58a8cdc2b943c85862790fa Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Tue, 19 Dec 2023 21:51:26 -0800 Subject: [PATCH] Fmt --- crates/sml-hir-lower/src/dec.rs | 10 +++------- crates/sml-hir-lower/src/exp.rs | 6 ++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/sml-hir-lower/src/dec.rs b/crates/sml-hir-lower/src/dec.rs index 43777c49..c1777a5c 100644 --- a/crates/sml-hir-lower/src/dec.rs +++ b/crates/sml-hir-lower/src/dec.rs @@ -583,11 +583,8 @@ fn get_one(st: &mut St<'_>, dec: ast::DecOne) -> Option { } } } - let pat = if pats.len() == 1 { - pats.pop().unwrap() - } else { - st.pat(pat::tuple(pats), ptr) - }; + let pat = + if pats.len() == 1 { pats.pop().unwrap() } else { st.pat(pat::tuple(pats), ptr) }; let ty = case.ty_annotation().map(|ty_ann| { forbid_opaque_asc(st, ty_ann.ascription()); ty::get(st, ty_ann.ty()) @@ -620,8 +617,7 @@ fn get_one(st: &mut St<'_>, dec: ast::DecOne) -> Option { } let exp = { let arg_names: Vec<_> = (0..num_pats.unwrap_or(1)).map(|_| st.fresh()).collect(); - let mut arg_exprs = - arg_names.iter().map(|name| st.exp(exp::name(name.as_str()), ptr)); + let mut arg_exprs = arg_names.iter().map(|name| st.exp(exp::name(name.as_str()), ptr)); let head = if arg_exprs.len() == 1 { arg_exprs.next().unwrap() } else { diff --git a/crates/sml-hir-lower/src/exp.rs b/crates/sml-hir-lower/src/exp.rs index ca57d7a6..51da7e7e 100644 --- a/crates/sml-hir-lower/src/exp.rs +++ b/crates/sml-hir-lower/src/exp.rs @@ -63,8 +63,7 @@ pub(crate) fn get(st: &mut St<'_>, exp: Option) -> sml_hir::ExpIdx { let lab = get_lab(st, exp.lab()?); let fresh = st.fresh(); let pat = st.pat(pat::name(fresh.as_str()), ptr); - let param = - st.pat(sml_hir::Pat::Record { rows: vec![(lab, pat)], allows_other: true }, ptr); + let param = st.pat(sml_hir::Pat::Record { rows: vec![(lab, pat)], allows_other: true }, ptr); let body = st.exp(name(fresh.as_str()), ptr); let arm = sml_hir::Arm { pat: param, exp: body }; sml_hir::Exp::Fn(vec![arm], sml_hir::FnFlavor::Selector) @@ -248,8 +247,7 @@ pub(crate) fn get(st: &mut St<'_>, exp: Option) -> sml_hir::ExpIdx { let fn_exp = st.exp(sml_hir::Exp::Fn(vec![arm], sml_hir::FnFlavor::While), ptr); let vid_pat = st.pat(pat::name(vid.as_str()), ptr); let bind = sml_hir::ValBind { rec: true, pat: vid_pat, exp: fn_exp }; - let val = - st.dec(sml_hir::Dec::Val(vec![], vec![bind], sml_hir::ValFlavor::While), ptr); + let val = st.dec(sml_hir::Dec::Val(vec![], vec![bind], sml_hir::ValFlavor::While), ptr); sml_hir::Exp::Let(vec![val], call_unit_fn(st, &vid, ptr)) } ast::Exp::CaseExp(exp) => {