Skip to content

Commit

Permalink
Merge pull request #424 from sunng87/fix/upper-case-acronyms
Browse files Browse the repository at this point in the history
(fix) fix upper-case acronyms where it is possible
  • Loading branch information
sunng87 committed Mar 26, 2021
2 parents 3394484 + 9dcb05a commit 16fdbd1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Expand Up @@ -250,7 +250,7 @@ impl fmt::Display for TemplateError {
quick_error! {
#[derive(Debug)]
pub enum ScriptError {
IOError(err: IOError) {
IoError(err: IOError) {
from()
source(err)
}
Expand Down
6 changes: 3 additions & 3 deletions src/render.rs
Expand Up @@ -761,8 +761,8 @@ impl Renderable for TemplateElement {
out.write(v.as_ref())?;
Ok(())
}
Expression(ref ht) | HTMLExpression(ref ht) => {
let is_html_expression = matches!(self, HTMLExpression(_));
Expression(ref ht) | HtmlExpression(ref ht) => {
let is_html_expression = matches!(self, HtmlExpression(_));
if is_html_expression {
rc.set_disable_escape(true);
}
Expand Down Expand Up @@ -883,7 +883,7 @@ fn test_expression() {
#[test]
fn test_html_expression() {
let r = Registry::new();
let element = HTMLExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths(
let element = HtmlExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths(
&["hello"],
))));

Expand Down
6 changes: 3 additions & 3 deletions src/template.rs
Expand Up @@ -602,7 +602,7 @@ impl Template {
let el = if rule == Rule::expression {
Expression(Box::new(helper_template))
} else {
HTMLExpression(Box::new(helper_template))
HtmlExpression(Box::new(helper_template))
};
let t = template_stack.front_mut().unwrap();
t.push_element(el, line_no, col_no);
Expand Down Expand Up @@ -722,7 +722,7 @@ impl Template {
#[derive(PartialEq, Clone, Debug)]
pub enum TemplateElement {
RawString(String),
HTMLExpression(Box<HelperTemplate>),
HtmlExpression(Box<HelperTemplate>),
Expression(Box<HelperTemplate>),
HelperBlock(Box<HelperTemplate>),
DecoratorExpression(Box<DecoratorTemplate>),
Expand Down Expand Up @@ -781,7 +781,7 @@ fn test_parse_template() {

assert_eq!(
*t.elements.get(3).unwrap(),
HTMLExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths(
HtmlExpression(Box::new(HelperTemplate::with_path(Path::with_named_paths(
&["content"],
))))
);
Expand Down

0 comments on commit 16fdbd1

Please sign in to comment.