summaryrefslogtreecommitdiff
path: root/src/directive/graph.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/directive/graph.rs')
-rw-r--r--src/directive/graph.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/directive/graph.rs b/src/directive/graph.rs
index 8234ed2..e7ae5fe 100644
--- a/src/directive/graph.rs
+++ b/src/directive/graph.rs
@@ -1,3 +1,4 @@
+use crate::directive::DirectiveImplementation;
use crate::error::SiteError;
use crate::page::PageMeta;
use crate::site::Site;
@@ -6,18 +7,17 @@ use crate::wikitext::ParsedDirective;
#[derive(Debug, Default, Eq, PartialEq)]
pub struct Graph {}
-impl Graph {
- pub const REQUIRED: &'static [&'static str] = &[];
- pub const ALLOWED: &'static [&'static str] = &["src", "type"];
- pub const ALLOW_ANY_UNNAMED: bool = true;
+impl DirectiveImplementation for Graph {
+ const REQUIRED: &'static [&'static str] = &[];
+ const ALLOWED: &'static [&'static str] = &["src", "type"];
+ const ALLOW_ANY_UNNAMED: bool = true;
- pub fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> {
- Err(SiteError::UnimplementedDirective("graph".into()))
+ fn from_parsed(_: &ParsedDirective) -> Self {
+ Self::default()
}
-}
-impl From<&ParsedDirective> for Graph {
- fn from(_: &ParsedDirective) -> Self {
- Graph::default()
+ fn process(&self, _site: &Site, _meta: &mut PageMeta) -> Result<String, SiteError> {
+ Err(SiteError::UnimplementedDirective("graph".into()))
}
+
}