diff options
Diffstat (limited to 'src/directive/pagestats.rs')
-rw-r--r-- | src/directive/pagestats.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/directive/pagestats.rs b/src/directive/pagestats.rs index 89ba57e..08df39d 100644 --- a/src/directive/pagestats.rs +++ b/src/directive/pagestats.rs @@ -1,3 +1,4 @@ +use crate::directive::DirectiveImplementation; use crate::error::SiteError; use crate::page::PageMeta; use crate::site::Site; @@ -6,22 +7,16 @@ use crate::wikitext::ParsedDirective; #[derive(Debug, Default, Eq, PartialEq)] pub struct PageStats {} -impl PageStats { - pub const REQUIRED: &'static [&'static str] = &["pages"]; - pub const ALLOWED: &'static [&'static str] = &["among", "style"]; - pub const ALLOW_ANY_UNNAMED: bool = true; +impl DirectiveImplementation for PageStats { + const REQUIRED: &'static [&'static str] = &["pages"]; + const ALLOWED: &'static [&'static str] = &["among", "style"]; + const ALLOW_ANY_UNNAMED: bool = true; - pub fn new() -> Self { + fn from_parsed(_: &ParsedDirective) -> Self { Self::default() } - pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { + fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> { Err(SiteError::UnimplementedDirective("pagestat".into())) } } - -impl From<&ParsedDirective> for PageStats { - fn from(_p: &ParsedDirective) -> Self { - Self::new() - } -} |