Skip to content

Commit 020f7ce

Browse files
authored
Merge pull request #98 from kaj/edition2018
Update ructe itself to edition 2018.
2 parents f052b73 + 4c64897 commit 020f7ce

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ project adheres to
1212
* Try to improve incremental compile times of projects using ructe by
1313
only writing fils if their contents actually changed. Also some code
1414
cleanup. PR #97.
15+
* Update ructe itself to use edition 2018 (it is still useable for
16+
projects using both editios). PR #98.
1517
* Update optional rsass dependency to 0.16.0.
1618
* Add optional support for tide 0.14 and 0.15.
1719
* Update gotham to 0.5 and axtix-web to 3.2 in examples.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
keywords = ["web", "templating", "template", "html"]
1010
categories = ["template-engine", "web-programming"]
1111
license = "MIT/Apache-2.0"
12+
edition = "2018"
1213

1314
[features]
1415
sass = ["rsass"]

src/expression.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
use crate::parseresult::PResult;
12
use nom::branch::alt;
23
use nom::bytes::complete::{escaped, is_a, is_not, tag};
34
use nom::character::complete::{alpha1, char, digit1, none_of, one_of};
45
use nom::combinator::{map, map_res, not, opt, recognize, value};
56
use nom::error::context; //, VerboseError};
67
use nom::multi::{fold_many0, many0, separated_list};
78
use nom::sequence::{delimited, pair, preceded, terminated, tuple};
8-
use parseresult::PResult;
99
use std::str::{from_utf8, Utf8Error};
1010

1111
pub fn expression(input: &[u8]) -> PResult<&str> {
@@ -145,7 +145,7 @@ pub fn rust_comment(input: &[u8]) -> PResult<&[u8]> {
145145

146146
#[cfg(test)]
147147
mod test {
148-
use expression::expression;
148+
use super::expression;
149149

150150
#[test]
151151
fn expression_1() {

src/spacelike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use crate::parseresult::PResult;
12
use nom::branch::alt;
23
use nom::bytes::complete::{is_not, tag};
34
use nom::character::complete::{multispace1, none_of};
45
use nom::combinator::{map, value};
56
use nom::multi::many0;
67
use nom::sequence::preceded;
7-
use parseresult::PResult;
88

99
pub fn spacelike(input: &[u8]) -> PResult<()> {
1010
map(many0(alt((comment, map(multispace1, |_| ())))), |_| ())(input)

src/template.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use expression::{input_to_str, rust_name};
1+
use crate::expression::{input_to_str, rust_name};
2+
use crate::nom_delimited_list::delimited_list;
3+
use crate::parseresult::PResult;
4+
use crate::spacelike::spacelike;
5+
use crate::templateexpression::{template_expression, TemplateExpression};
26
use itertools::Itertools;
37
use nom::branch::alt;
48
use nom::bytes::complete::is_not;
@@ -8,11 +12,7 @@ use nom::combinator::{map, map_res, opt, recognize};
812
use nom::error::context;
913
use nom::multi::{many0, many_till, separated_list};
1014
use nom::sequence::{delimited, preceded, terminated, tuple};
11-
use nom_delimited_list::delimited_list;
12-
use parseresult::PResult;
13-
use spacelike::spacelike;
1415
use std::io::{self, Write};
15-
use templateexpression::{template_expression, TemplateExpression};
1616

1717
#[derive(Debug, PartialEq, Eq)]
1818
pub struct Template {
@@ -167,7 +167,7 @@ pub fn comma_type_expressions(input: &[u8]) -> PResult<()> {
167167

168168
#[cfg(test)]
169169
mod test {
170-
use template::type_expression;
170+
use super::type_expression;
171171

172172
#[test]
173173
fn tuple() {

src/templateexpression.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use expression::{
1+
use crate::expression::{
22
comma_expressions, expr_in_braces, expr_inside_parens, expression,
33
input_to_str, rust_name,
44
};
5+
use crate::parseresult::PResult;
6+
use crate::spacelike::{comment_tail, spacelike};
57
use itertools::Itertools;
68
use nom::branch::alt;
79
use nom::bytes::complete::is_not;
@@ -11,8 +13,6 @@ use nom::combinator::{map, map_res, opt, recognize, value};
1113
use nom::error::context;
1214
use nom::multi::{many0, many_till, separated_list};
1315
use nom::sequence::{delimited, pair, preceded, terminated, tuple};
14-
use parseresult::PResult;
15-
use spacelike::{comment_tail, spacelike};
1616
use std::fmt::{self, Display};
1717

1818
#[derive(Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)