improve code (some clippy::pedantic lints)

This commit is contained in:
nora 2022-01-04 22:01:55 +01:00
parent a42cec3075
commit 5699ab190a
7 changed files with 33 additions and 36 deletions

View file

@ -28,8 +28,7 @@ impl Env<'_> {
env.locals.get(&name.sym).copied().or_else(|| {
env.outer
.as_ref()
.map(|outer| lookup_inner(&outer.borrow(), name))
.flatten()
.and_then(|outer| lookup_inner(&outer.borrow(), name))
})
}
@ -68,7 +67,7 @@ pub fn compile<'ast, 'bc, 'gc>(
blocks: Vec::new_in(bytecode_bump),
current_block: 0,
bump: bytecode_bump,
env: Rc::new(RefCell::new(Default::default())),
env: Rc::new(RefCell::new(Env::default())),
rt,
};