Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
CeleritasCelery committed Feb 9, 2024
1 parent a0d13b2 commit c3e5795
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/fns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,9 @@ pub(crate) fn require<'ob>(
};
let file = file.into_obj(cx);
root!(file, cx);
match crate::lread::load(file, None, None, cx, env) {
match crate::lread::load(file, noerror, None, cx, env) {
Ok(_) => Ok(feature.untag(cx)),
Err(e) => match noerror {
Some(()) => Ok(sym::NIL),
None => Err(e),
},
Err(e) => Err(e),
}
}

Expand Down Expand Up @@ -866,6 +863,11 @@ mod test {
let res = nreverse(list.try_into().unwrap()).unwrap();
assert_eq!(res, list![4, 3, 2, 1; cx]);
}
{
let list = list![1, 2,; cx];
let res = nreverse(list.try_into().unwrap()).unwrap();
assert_eq!(res, list![2, 1; cx]);
}
{
let list = list![1; cx];
let res = nreverse(list.try_into().unwrap()).unwrap();
Expand Down

0 comments on commit c3e5795

Please sign in to comment.