From 4e9a13b99f2de881b86862486576684f21e96c68 Mon Sep 17 00:00:00 2001 From: HeroesGrave Date: Mon, 17 Nov 2014 14:26:02 +1300 Subject: [PATCH] fix for un-feature-gated struct variants --- src/lib.rs | 3 +-- src/reader/events.rs | 18 +++++++++--------- src/writer/events.rs | 26 +++++++++++++------------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4fd80ff3..24094908 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ //#![warn(missing_doc)] #![forbid(non_camel_case_types)] -#![feature(macro_rules, struct_variant, tuple_indexing)] +#![feature(macro_rules, tuple_indexing)] //! This crate currently provides almost XML 1.0/1.1-compliant pull parser. @@ -13,4 +13,3 @@ pub mod common; pub mod namespace; pub mod reader; pub mod writer; - diff --git a/src/reader/events.rs b/src/reader/events.rs index 5f2e6cc4..3e21fc3c 100644 --- a/src/reader/events.rs +++ b/src/reader/events.rs @@ -21,21 +21,21 @@ pub enum XmlEvent { /// XML version. /// /// If XML declaration is not present, defaults to `Version10`. - pub version: XmlVersion, + version: XmlVersion, /// XML document encoding. /// /// If XML declaration is not present or does not contain `encoding` attribute, /// defaults to `"UTF-8"`. This field is currently used for no other purpose than /// informational. - pub encoding: String, + encoding: String, /// XML standalone declaration. /// /// If XML document is not present or does not contain `standalone` attribute, /// defaults to `None`. This field is currently used for no other purpose than /// informational. - pub standalone: Option + standalone: Option }, /// Denotes to the end of the document stream. @@ -50,10 +50,10 @@ pub enum XmlEvent { /// is up to the application to process them. ProcessingInstruction { /// Processing instruction target. - pub name: String, + name: String, /// Processing instruction content. - pub data: Option + data: Option }, /// Denotes a beginning of an XML element. @@ -62,15 +62,15 @@ pub enum XmlEvent { /// latter case `EndElement` event immediately follows. StartElement { /// Qualified name of the element. - pub name: Name, + name: Name, /// A list of attributes associated with the element. /// /// Currently attributes are not checked for duplicates (TODO) - pub attributes: Vec, + attributes: Vec, /// Contents of the namespace mapping at this point of the document. - pub namespace: Namespace, + namespace: Namespace, }, /// Denotes an end of an XML document. @@ -79,7 +79,7 @@ pub enum XmlEvent { /// latter case it is emitted immediately after corresponding `StartElement` event. EndElement { /// Qualified name of the element. - pub name: Name + name: Name }, /// Denotes CDATA content. diff --git a/src/writer/events.rs b/src/writer/events.rs index 9ea8fe3f..d812170d 100644 --- a/src/writer/events.rs +++ b/src/writer/events.rs @@ -6,7 +6,7 @@ use namespace::Namespace; /// Items of this enum are consumed by `writer::EventWriter`. They correspond to different /// elements of an XML document. pub enum XmlEvent<'a> { - /// Corresponds to XML document declaration. + /// Corresponds to XML document declaration. /// /// This event should always be written before any other event. If it is not written /// at all, default XML declaration will be outputted. @@ -14,25 +14,25 @@ pub enum XmlEvent<'a> { /// XML version. /// /// If XML declaration is not present, defaults to `Version10`. - pub version: XmlVersion, + version: XmlVersion, /// XML document encoding. - pub encoding: Option<&'a str>, + encoding: Option<&'a str>, /// XML standalone declaration. - pub standalone: Option + standalone: Option }, /// Denotes an XML processing instruction. /// /// This event contains a processing instruction target (`name`) and opaque `data`. It /// is up to the application to process them. - ProcessingInstruction { + ProcessingInstruction { /// Processing instruction target. - pub name: &'a str, + name: &'a str, /// Processing instruction content. - pub data: Option<&'a str> + data: Option<&'a str> }, /// Denotes a beginning of an XML element. @@ -42,17 +42,17 @@ pub enum XmlEvent<'a> { /// /// TODO: ideally names and attributes should be entirely references, /// including internal strings. - StartElement { + StartElement { /// Qualified name of the element. - pub name: &'a Name, + name: &'a Name, /// A list of attributes associated with the element. - /// + /// /// Currently attributes are not checked for duplicates (TODO). - pub attributes: &'a [Attribute], + attributes: &'a [Attribute], /// Contents of the namespace mapping at this point of the document. - pub namespace: &'a Namespace, + namespace: &'a Namespace, }, /// Denotes an end of an XML document. @@ -61,7 +61,7 @@ pub enum XmlEvent<'a> { /// latter case it is emitted immediately after corresponding `StartElement` event. EndElement { /// Qualified name of the element. - pub name: &'a Name + name: &'a Name }, /// Denotes CDATA content.