diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-12-07 15:41:35 +0100 |
---|---|---|
committer | Juan Aguilar <mhpoin@gmail.com> | 2018-12-08 21:43:20 +0100 |
commit | d042c5d758a0b99288b99959d5d98462f18cde65 (patch) | |
tree | 76a3bc0744927ea976e94888e989dd96a417647f | |
parent | cf8dc532f04440d5968265ee26852966c4a6c7b3 (diff) | |
download | askama-d042c5d758a0b99288b99959d5d98462f18cde65.tar.gz askama-d042c5d758a0b99288b99959d5d98462f18cde65.tar.bz2 askama-d042c5d758a0b99288b99959d5d98462f18cde65.zip |
Upgrade to 2018 edition
Diffstat (limited to '')
-rw-r--r-- | askama/Cargo.toml | 1 | ||||
-rw-r--r-- | askama/src/lib.rs | 4 | ||||
-rw-r--r-- | askama_derive/Cargo.toml | 1 | ||||
-rw-r--r-- | askama_derive/src/generator.rs | 8 | ||||
-rw-r--r-- | askama_derive/src/input.rs | 2 | ||||
-rw-r--r-- | askama_derive/src/lib.rs | 10 | ||||
-rw-r--r-- | askama_derive/src/parser.rs | 6 | ||||
-rw-r--r-- | askama_escape/Cargo.toml | 1 | ||||
-rw-r--r-- | askama_shared/Cargo.toml | 1 | ||||
-rw-r--r-- | askama_shared/src/filters/mod.rs | 2 | ||||
-rw-r--r-- | askama_shared/src/lib.rs | 2 | ||||
-rw-r--r-- | testing/Cargo.toml | 1 |
12 files changed, 22 insertions, 17 deletions
diff --git a/askama/Cargo.toml b/askama/Cargo.toml index 5a97ef2..7c85a92 100644 --- a/askama/Cargo.toml +++ b/askama/Cargo.toml @@ -11,6 +11,7 @@ repository = "https://github.com/djc/askama" license = "MIT OR Apache-2.0" workspace = ".." readme = "../README.md" +edition = "2018" [badges] appveyor = { repository = "djc/askama" } diff --git a/askama/src/lib.rs b/askama/src/lib.rs index c70d87b..d56d8b0 100644 --- a/askama/src/lib.rs +++ b/askama/src/lib.rs @@ -422,9 +422,9 @@ pub trait Template { Self: Sized; } +pub use crate::shared::filters; +pub use crate::shared::{read_config_file, Error, MarkupDisplay, Result}; pub use askama_derive::*; -pub use shared::filters; -pub use shared::{read_config_file, Error, MarkupDisplay, Result}; #[cfg(feature = "with-iron")] pub mod iron { diff --git a/askama_derive/Cargo.toml b/askama_derive/Cargo.toml index 2a95a77..7096597 100644 --- a/askama_derive/Cargo.toml +++ b/askama_derive/Cargo.toml @@ -7,6 +7,7 @@ homepage = "https://github.com/djc/askama" repository = "https://github.com/djc/askama" license = "MIT/Apache-2.0" workspace = ".." +edition = "2018" [lib] proc-macro = true diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 128811a..dc1c551 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -1,7 +1,7 @@ use super::{get_template_source, Context, Heritage}; -use input::TemplateInput; -use parser::{Cond, Expr, MatchParameter, MatchVariant, Node, Target, When, WS}; -use shared::filters; +use crate::input::TemplateInput; +use crate::parser::{Cond, Expr, MatchParameter, MatchVariant, Node, Target, When, WS}; +use crate::shared::filters; use proc_macro2::Span; @@ -13,7 +13,7 @@ use std::{cmp, hash, mem, str}; use syn; -use parser::parse; +use crate::parser::parse; pub(crate) fn generate( input: &TemplateInput, diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs index f4da43c..f79186d 100644 --- a/askama_derive/src/input.rs +++ b/askama_derive/src/input.rs @@ -2,7 +2,7 @@ use proc_macro2::TokenStream; use quote::ToTokens; -use shared::{Config, Syntax}; +use crate::shared::{Config, Syntax}; use std::path::PathBuf; diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 5c84004..d6900d7 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -11,12 +11,12 @@ mod generator; mod input; mod parser; -use input::{Print, Source, TemplateInput}; -use parser::{Expr, Macro, Node}; +use crate::input::{Print, Source, TemplateInput}; +use crate::parser::{Expr, Macro, Node}; +use crate::shared::{read_config_file, Config}; use proc_macro::TokenStream; -use shared::{read_config_file, Config}; -use parser::parse; +use crate::parser::parse; use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; @@ -220,7 +220,7 @@ fn get_template_source(tpl_path: &Path) -> String { #[cfg(test)] mod tests { use super::get_template_source; - use Config; + use crate::Config; #[test] fn get_source() { diff --git a/askama_derive/src/parser.rs b/askama_derive/src/parser.rs index 742a7a2..08013e9 100644 --- a/askama_derive/src/parser.rs +++ b/askama_derive/src/parser.rs @@ -4,7 +4,7 @@ use nom; use std::str; -use shared::Syntax; +use crate::shared::Syntax; #[derive(Debug)] pub enum Expr<'a> { @@ -123,7 +123,7 @@ fn take_content<'a>( i: Input<'a>, s: &'a Syntax<'a>, ) -> Result<(Input<'a>, Node<'a>), nom::Err<Input<'a>>> { - use parser::ContentState::*; + use crate::parser::ContentState::*; let bs = s.block_start.as_bytes()[0]; let be = s.block_start.as_bytes()[1]; let cs = s.comment_start.as_bytes()[0]; @@ -771,7 +771,7 @@ pub fn parse<'a>(src: &'a str, syntax: &'a Syntax<'a>) -> Vec<Node<'a>> { #[cfg(test)] mod tests { - use shared::Syntax; + use crate::shared::Syntax; fn check_ws_split(s: &str, res: &(&str, &str, &str)) { let node = super::split_ws_parts(s.as_bytes()); diff --git a/askama_escape/Cargo.toml b/askama_escape/Cargo.toml index ee84891..983a281 100644 --- a/askama_escape/Cargo.toml +++ b/askama_escape/Cargo.toml @@ -9,6 +9,7 @@ homepage = "https://github.com/djc/askama" repository = "https://github.com/djc/askama" license = "MIT OR Apache-2.0" workspace = ".." +edition = "2018" [badges] appveyor = { repository = "djc/askama" } diff --git a/askama_shared/Cargo.toml b/askama_shared/Cargo.toml index 39ee358..f8fafe3 100644 --- a/askama_shared/Cargo.toml +++ b/askama_shared/Cargo.toml @@ -7,6 +7,7 @@ homepage = "https://github.com/djc/askama" repository = "https://github.com/djc/askama" license = "MIT/Apache-2.0" workspace = ".." +edition = "2018" [dependencies] askama_escape = { version = "0.1.0", path = "../askama_escape" } diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index cf94092..0be9f95 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -10,8 +10,8 @@ mod json; #[cfg(feature = "serde_json")] pub use self::json::json; +use crate::error::Error::Fmt; use askama_escape::MarkupDisplay; -use error::Error::Fmt; use humansize::{file_size_opts, FileSize}; use num_traits::cast::NumCast; use num_traits::Signed; diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs index 07967f4..adb41b5 100644 --- a/askama_shared/src/lib.rs +++ b/askama_shared/src/lib.rs @@ -16,8 +16,8 @@ use std::path::{Path, PathBuf}; mod error; +pub use crate::error::{Error, Result}; pub use askama_escape::MarkupDisplay; -pub use error::{Error, Result}; use std::collections::BTreeMap; diff --git a/testing/Cargo.toml b/testing/Cargo.toml index 3071542..16d2f34 100644 --- a/testing/Cargo.toml +++ b/testing/Cargo.toml @@ -3,6 +3,7 @@ name = "askama_testing" version = "0.1.0" authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"] workspace = ".." +edition = "2018" [features] actix = ["actix-web", "bytes", "askama/with-actix-web"] |