diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-02 15:43:29 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-02 15:43:29 +0200 |
| commit | 3533268b1f7a31581e7b8f44dff6d4f553ef348f (patch) | |
| tree | 3fee21d2df7ce173131f75f46a1ef040f272ed29 /src/library | |
| parent | f8770d2b2a8ac389704897f92f2753398352835b (diff) | |
Refactor parser 🏞
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/boxed.rs | 2 | ||||
| -rw-r--r-- | src/library/mod.rs | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/library/boxed.rs b/src/library/boxed.rs index e02b8c0c..85025264 100644 --- a/src/library/boxed.rs +++ b/src/library/boxed.rs @@ -13,7 +13,7 @@ pub async fn boxed( ) -> Pass<Value> { let mut f = Feedback::new(); - let content = args.take::<SynTree>().unwrap_or(SynTree::new()); + let content = args.take::<SynTree>().unwrap_or_default(); ctx.base = ctx.spaces[0].size; ctx.spaces.truncate(1); diff --git a/src/library/mod.rs b/src/library/mod.rs index a5fdfc4c..43f74318 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -14,9 +14,7 @@ pub use font::*; pub use page::*; pub use spacing::*; -use std::rc::Rc; - -use crate::eval::Scope; +use crate::eval::{FuncValue, Scope}; use crate::prelude::*; macro_rules! std { @@ -32,7 +30,7 @@ macro_rules! std { macro_rules! wrap { ($func:expr) => { - Rc::new(|name, args, ctx| Box::pin($func(name, args, ctx))) + FuncValue::new(|name, args, ctx| Box::pin($func(name, args, ctx))) }; } |
