diff options
author | René Kijewski <kijewski@library.vetmed.fu-berlin.de> | 2022-03-10 09:02:10 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-03-23 19:37:10 +0100 |
commit | 07584691a8b2ff44776d22c9f9b2c4ec1b303948 (patch) | |
tree | 43549d7d414aad8c728b7f6b6e3c67c0b6004898 /askama_shared/src/input.rs | |
parent | 4c0388d11e1bafb85250b649ff610d3f9c7f9452 (diff) | |
download | askama-07584691a8b2ff44776d22c9f9b2c4ec1b303948.tar.gz askama-07584691a8b2ff44776d22c9f9b2c4ec1b303948.tar.bz2 askama-07584691a8b2ff44776d22c9f9b2c4ec1b303948.zip |
Un-"pub" most of askama_shared's internals
Previously askama_shared exported most of it's internals, so
askama_derive could use them. This is not needed anymore.
Diffstat (limited to 'askama_shared/src/input.rs')
-rw-r--r-- | askama_shared/src/input.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/askama_shared/src/input.rs b/askama_shared/src/input.rs index f7eac23..c70b250 100644 --- a/askama_shared/src/input.rs +++ b/askama_shared/src/input.rs @@ -6,17 +6,17 @@ use std::str::FromStr; use mime::Mime; use quote::ToTokens; -pub struct TemplateInput<'a> { - pub ast: &'a syn::DeriveInput, - pub config: &'a Config<'a>, - pub syntax: &'a Syntax<'a>, - pub source: Source, - pub print: Print, - pub escaper: &'a str, - pub ext: Option<String>, - pub mime_type: String, - pub parent: Option<&'a syn::Type>, - pub path: PathBuf, +pub(crate) struct TemplateInput<'a> { + pub(crate) ast: &'a syn::DeriveInput, + pub(crate) config: &'a Config<'a>, + pub(crate) syntax: &'a Syntax<'a>, + pub(crate) source: Source, + pub(crate) print: Print, + pub(crate) escaper: &'a str, + pub(crate) ext: Option<String>, + pub(crate) mime_type: String, + pub(crate) parent: Option<&'a syn::Type>, + pub(crate) path: PathBuf, } impl TemplateInput<'_> { @@ -24,7 +24,7 @@ impl TemplateInput<'_> { /// mostly recovers the data for the `TemplateInput` fields from the /// `template()` attribute list fields; it also finds the of the `_parent` /// field, if any. - pub fn new<'n>( + pub(crate) fn new<'n>( ast: &'n syn::DeriveInput, config: &'n Config<'_>, ) -> Result<TemplateInput<'n>, CompileError> { @@ -209,13 +209,13 @@ impl TemplateInput<'_> { } #[inline] - pub fn extension(&self) -> Option<&str> { + pub(crate) fn extension(&self) -> Option<&str> { ext_default_to_path(self.ext.as_deref(), &self.path) } } #[inline] -pub fn ext_default_to_path<'a>(ext: Option<&'a str>, path: &'a Path) -> Option<&'a str> { +fn ext_default_to_path<'a>(ext: Option<&'a str>, path: &'a Path) -> Option<&'a str> { ext.or_else(|| extension(path)) } @@ -233,13 +233,13 @@ fn extension(path: &Path) -> Option<&str> { } } -pub enum Source { +pub(crate) enum Source { Path(String), Source(String), } #[derive(PartialEq)] -pub enum Print { +pub(crate) enum Print { All, Ast, Code, |