From 6f6af4f26a46e49975be6eabe0a145067d09eedc Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Fri, 21 Jul 2017 16:56:37 -0500 Subject: [PATCH] make more stuff public --- contrib/src/lib.rs | 4 ++-- contrib/src/templates/engine.rs | 4 ++-- contrib/src/templates/handlebars_templates.rs | 2 +- contrib/src/templates/mod.rs | 11 +++++++++++ contrib/src/templates/tera_templates.rs | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/contrib/src/lib.rs b/contrib/src/lib.rs index 7764b16e..39ac0445 100644 --- a/contrib/src/lib.rs +++ b/contrib/src/lib.rs @@ -64,10 +64,10 @@ pub mod msgpack; pub use msgpack::{MsgPack, MsgPackError}; #[cfg(feature = "templates")] -mod templates; +pub mod templates; #[cfg(feature = "templates")] -pub use templates::{Template, Context as TemplateContext}; +pub use templates::Template; #[cfg(feature = "uuid")] mod uuid; diff --git a/contrib/src/templates/engine.rs b/contrib/src/templates/engine.rs index 0136c4b1..55f84a02 100644 --- a/contrib/src/templates/engine.rs +++ b/contrib/src/templates/engine.rs @@ -15,9 +15,9 @@ pub trait Engine: Send + Sync + 'static { pub struct Engines { #[cfg(feature = "tera_templates")] - tera: Tera, + pub tera: Tera, #[cfg(feature = "handlebars_templates")] - handlebars: Handlebars, + pub handlebars: Handlebars, } impl Engines { diff --git a/contrib/src/templates/handlebars_templates.rs b/contrib/src/templates/handlebars_templates.rs index c7f7bdf2..3542a522 100644 --- a/contrib/src/templates/handlebars_templates.rs +++ b/contrib/src/templates/handlebars_templates.rs @@ -1,4 +1,4 @@ -extern crate handlebars; +pub extern crate handlebars; use super::serde::Serialize; use super::{Engine, TemplateInfo}; diff --git a/contrib/src/templates/mod.rs b/contrib/src/templates/mod.rs index 73ec8689..a58aabd9 100644 --- a/contrib/src/templates/mod.rs +++ b/contrib/src/templates/mod.rs @@ -3,7 +3,16 @@ extern crate serde_json; extern crate glob; #[cfg(feature = "tera_templates")] mod tera_templates; + +#[cfg(feature = "tera_templates")] +pub use self::tera_templates::{tera, Tera}; + #[cfg(feature = "handlebars_templates")] mod handlebars_templates; + +#[cfg(feature = "handlebars_templates")] +pub use self::handlebars_templates::{handlebars, Handlebars}; + + mod engine; mod context; @@ -23,6 +32,8 @@ use rocket::http::{ContentType, Status}; pub use self::context::Context; + + const DEFAULT_TEMPLATE_DIR: &'static str = "templates"; /// The Template type implements generic support for template rendering in diff --git a/contrib/src/templates/tera_templates.rs b/contrib/src/templates/tera_templates.rs index f4fb9892..a580866b 100644 --- a/contrib/src/templates/tera_templates.rs +++ b/contrib/src/templates/tera_templates.rs @@ -1,4 +1,4 @@ -extern crate tera; +pub extern crate tera; use super::serde::Serialize; use super::{Engine, TemplateInfo};