Skip to content

fix for un-feature-gated struct variants #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -13,4 +13,3 @@ pub mod common;
pub mod namespace;
pub mod reader;
pub mod writer;

18 changes: 9 additions & 9 deletions src/reader/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>
standalone: Option<bool>
},

/// Denotes to the end of the document stream.
Expand All @@ -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<String>
data: Option<String>
},

/// Denotes a beginning of an XML element.
Expand All @@ -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<Attribute>,
attributes: Vec<Attribute>,

/// Contents of the namespace mapping at this point of the document.
pub namespace: Namespace,
namespace: Namespace,
},

/// Denotes an end of an XML document.
Expand All @@ -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.
Expand Down
26 changes: 13 additions & 13 deletions src/writer/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ 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.
StartDocument {
/// 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<bool>
standalone: Option<bool>
},

/// 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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down