summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/align.rs11
-rw-r--r--src/library/mod.rs13
-rw-r--r--src/library/styles.rs1
3 files changed, 12 insertions, 13 deletions
diff --git a/src/library/align.rs b/src/library/align.rs
index 322a9efa..4dc5f53c 100644
--- a/src/library/align.rs
+++ b/src/library/align.rs
@@ -1,7 +1,6 @@
use super::prelude::*;
use crate::layout::Alignment;
-
/// Allows to align content in different ways.
#[derive(Debug, PartialEq)]
pub struct AlignFunc {
@@ -10,9 +9,8 @@ pub struct AlignFunc {
}
impl Function for AlignFunc {
- fn parse(header: &FuncHeader, body: Option<&str>, ctx: ParseContext)
- -> ParseResult<Self> where Self: Sized {
-
+ fn parse(header: &FuncHeader, body: Option<&str>, ctx: ParseContext) -> ParseResult<Self>
+ where Self: Sized {
if header.args.len() != 1 || !header.kwargs.is_empty() {
return err("expected exactly one positional argument specifying the alignment");
}
@@ -24,7 +22,10 @@ impl Function for AlignFunc {
s => return err(format!("invalid alignment specifier: '{}'", s)),
}
} else {
- return err(format!("expected alignment specifier, found: '{}'", header.args[0]));
+ return err(format!(
+ "expected alignment specifier, found: '{}'",
+ header.args[0]
+ ));
};
let body = if let Some(body) = body {
diff --git a/src/library/mod.rs b/src/library/mod.rs
index 848ba847..f3156b4a 100644
--- a/src/library/mod.rs
+++ b/src/library/mod.rs
@@ -7,11 +7,11 @@ mod styles;
/// Useful imports for creating your own functions.
pub mod prelude {
- pub use crate::syntax::{SyntaxTree, FuncHeader, Expression};
- pub use crate::parsing::{parse, ParseContext, ParseResult, ParseError};
- pub use crate::layout::{layout_tree, LayoutContext, MultiLayout, Layout};
- pub use crate::layout::{LayoutResult, LayoutError};
- pub use crate::func::{Function, Command, FuncCommands};
+ pub use crate::func::{Command, FuncCommands, Function};
+ pub use crate::layout::{layout_tree, Layout, LayoutContext, MultiLayout};
+ pub use crate::layout::{LayoutError, LayoutResult};
+ pub use crate::parsing::{parse, ParseContext, ParseError, ParseResult};
+ pub use crate::syntax::{Expression, FuncHeader, SyntaxTree};
pub fn err<S: Into<String>, T>(message: S) -> ParseResult<T> {
Err(ParseError::new(message))
@@ -19,8 +19,7 @@ pub mod prelude {
}
pub use align::AlignFunc;
-pub use styles::{ItalicFunc, BoldFunc, MonospaceFunc};
-
+pub use styles::{BoldFunc, ItalicFunc, MonospaceFunc};
/// Create a scope with all standard functions.
pub fn std() -> Scope {
diff --git a/src/library/styles.rs b/src/library/styles.rs
index c588ac5e..666c8975 100644
--- a/src/library/styles.rs
+++ b/src/library/styles.rs
@@ -2,7 +2,6 @@ use toddle::query::FontClass;
use super::prelude::*;
-
macro_rules! style_func {
(
$(#[$outer:meta])*