aboutsummaryrefslogtreecommitdiffstats
path: root/src/document_tree/elements.rs
diff options
context:
space:
mode:
authorPhilipp A2018-12-02 12:37:31 +0100
committerPhilipp A2018-12-02 12:37:31 +0100
commitfad2dff1c719470a4ed8542b05a210056de6949a (patch)
tree69142a504f085e6350e071a4c2d35a7b0e7e3b73 /src/document_tree/elements.rs
parent30f5d8b4a22c189bc8a4b24e9cf2bb4907ef191b (diff)
downloadrust-rst-fad2dff1c719470a4ed8542b05a210056de6949a.tar.bz2
Switched url to target
Diffstat (limited to 'src/document_tree/elements.rs')
-rw-r--r--src/document_tree/elements.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/document_tree/elements.rs b/src/document_tree/elements.rs
index 2b99d97..5f669ae 100644
--- a/src/document_tree/elements.rs
+++ b/src/document_tree/elements.rs
@@ -1,7 +1,6 @@
use serde_derive::Serialize;
-use url::Url;
-use super::serde_util::serialize_opt_url;
+use crate::target;
use super::extra_attributes::{self,ExtraAttributes};
use super::element_categories::*;
@@ -15,8 +14,8 @@ pub trait Element {
fn ids_mut(&mut self) -> &mut Vec<String>;
fn names (& self) -> & Vec<String>;
fn names_mut(&mut self) -> &mut Vec<String>;
- fn source (& self) -> & Option<Url>;
- fn source_mut(&mut self) -> &mut Option<Url>;
+ fn source (& self) -> & Option<target::Target>;
+ fn source_mut(&mut self) -> &mut Option<target::Target>;
fn classes (& self) -> & Vec<String>;
fn classes_mut(&mut self) -> &mut Vec<String>;
}
@@ -25,8 +24,7 @@ pub trait Element {
pub struct CommonAttributes {
ids: Vec<String>,
names: Vec<String>,
- #[serde(serialize_with = "serialize_opt_url")]
- source: Option<Url>,
+ source: Option<target::Target>,
classes: Vec<String>,
//left out dupnames
}
@@ -41,8 +39,8 @@ macro_rules! impl_element { ($name:ident) => (
fn ids_mut(&mut self) -> &mut Vec<String> { &mut self.common.ids }
fn names (& self) -> & Vec<String> { & self.common.names }
fn names_mut(&mut self) -> &mut Vec<String> { &mut self.common.names }
- fn source (& self) -> & Option<Url> { & self.common.source }
- fn source_mut(&mut self) -> &mut Option<Url> { &mut self.common.source }
+ fn source (& self) -> & Option<target::Target> { & self.common.source }
+ fn source_mut(&mut self) -> &mut Option<target::Target> { &mut self.common.source }
fn classes (& self) -> & Vec<String> { & self.common.classes }
fn classes_mut(&mut self) -> &mut Vec<String> { &mut self.common.classes }
}
@@ -251,7 +249,7 @@ impl_elems!(
);
impl<'a> From<&'a str> for TextOrInlineElement {
- fn from(s: &'a str) -> TextOrInlineElement {
+ fn from(s: &'a str) -> Self {
s.to_owned().into()
}
}