diff options
Diffstat (limited to 'src/func')
| -rw-r--r-- | src/func/mod.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/func/mod.rs b/src/func/mod.rs index c8cf23c6..a5328314 100644 --- a/src/func/mod.rs +++ b/src/func/mod.rs @@ -12,13 +12,7 @@ mod macros; /// Useful imports for creating your own functions. pub mod prelude { pub use crate::func::{Scope, ParseFunc, LayoutFunc, Command, Commands}; - pub use crate::layout::{ - layout_tree, Layout, MultiLayout, - LayoutContext, LayoutSpace, LayoutSpaces, LayoutExpansion, - LayoutAxes, Axis, GenericAxisKind, SpecificAxisKind, - LayoutAlignment, Alignment, - SpacingKind, LayoutResult, - }; + pub use crate::layout::prelude::*; pub use crate::syntax::{ parse, ParseContext, ParseResult, SyntaxTree, FuncCall, FuncArgs, PosArg, KeyArg, @@ -107,7 +101,7 @@ pub enum Command<'a> { Add(Layout), AddMultiple(MultiLayout), - AddSpacing(Size, SpacingKind, GenericAxisKind), + AddSpacing(Size, SpacingKind, GenericAxis), FinishLine, FinishRun, @@ -149,13 +143,13 @@ impl Scope { /// Associate the given name with a type that is parseable into a function. pub fn add<F>(&mut self, name: &str) where F: ParseFunc<Meta=()> + LayoutFunc + 'static { - self.add_with_metadata::<F, ()>(name, ()); + self.add_with_metadata::<F>(name, ()); } /// Add a parseable type with additional metadata that is given to the /// parser (other than the default of `()`). - pub fn add_with_metadata<F, T>(&mut self, name: &str, metadata: T) - where F: ParseFunc<Meta=T> + LayoutFunc + 'static, T: 'static + Clone { + pub fn add_with_metadata<F>(&mut self, name: &str, metadata: <F as ParseFunc>::Meta) + where F: ParseFunc + LayoutFunc + 'static { self.parsers.insert( name.to_owned(), Box::new(move |a, b, c| { |
