From c3e57950a0d3e0ee70df2a78fc4b8e24e3bbdf32 Mon Sep 17 00:00:00 2001 From: Troy Hinckley Date: Thu, 8 Feb 2024 22:48:19 -0600 Subject: [PATCH] Refactor --- src/fns.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/fns.rs b/src/fns.rs index cac165ea..458adcc5 100644 --- a/src/fns.rs +++ b/src/fns.rs @@ -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), } } @@ -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();