From 5fbf888773ba0461f557119a40474b50629835c8 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 27 Jan 2015 10:26:48 -0500 Subject: [PATCH] Update for rename of core::fmt::Show to core::fmt::Debug See /~https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md. --- macros/src/match_token.rs | 2 +- src/sink/common.rs | 2 +- src/tokenizer/buffer_queue.rs | 2 +- src/tokenizer/char_ref/mod.rs | 2 +- src/tokenizer/interface.rs | 10 +++++----- src/tokenizer/states.rs | 10 +++++----- src/tree_builder/actions.rs | 6 +++--- src/tree_builder/interface.rs | 2 +- src/tree_builder/types.rs | 6 +++--- src/util/str.rs | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/macros/src/match_token.rs b/macros/src/match_token.rs index 63129d91..9469b272 100644 --- a/macros/src/match_token.rs +++ b/macros/src/match_token.rs @@ -117,7 +117,7 @@ type Tokens = Vec; type TagName = ast::Ident; // FIXME: duplicated in src/tokenizer/interface.rs -#[derive(PartialEq, Eq, Hash, Copy, Clone, Show)] +#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)] enum TagKind { StartTag, EndTag, diff --git a/src/sink/common.rs b/src/sink/common.rs index 6a2b4b55..54b1f7bd 100644 --- a/src/sink/common.rs +++ b/src/sink/common.rs @@ -16,7 +16,7 @@ use string_cache::QualName; pub use self::NodeEnum::{Document, Doctype, Text, Comment, Element}; /// The different kinds of nodes in the DOM. -#[derive(Show)] +#[derive(Debug)] pub enum NodeEnum { /// The `Document` itself. Document, diff --git a/src/tokenizer/buffer_queue.rs b/src/tokenizer/buffer_queue.rs index 62f53318..ab5d3338 100644 --- a/src/tokenizer/buffer_queue.rs +++ b/src/tokenizer/buffer_queue.rs @@ -26,7 +26,7 @@ struct Buffer { } /// Result from `pop_except_from`. -#[derive(PartialEq, Eq, Show)] +#[derive(PartialEq, Eq, Debug)] pub enum SetResult { FromSet(char), NotFromSet(String), diff --git a/src/tokenizer/char_ref/mod.rs b/src/tokenizer/char_ref/mod.rs index 7c1434e5..c7d7ba59 100644 --- a/src/tokenizer/char_ref/mod.rs +++ b/src/tokenizer/char_ref/mod.rs @@ -37,7 +37,7 @@ pub enum Status { Done, } -#[derive(Show)] +#[derive(Debug)] enum State { Begin, Octothorpe, diff --git a/src/tokenizer/interface.rs b/src/tokenizer/interface.rs index 4ec5c332..9762fe7d 100644 --- a/src/tokenizer/interface.rs +++ b/src/tokenizer/interface.rs @@ -25,7 +25,7 @@ pub use self::Token::{NullCharacterToken, EOFToken, ParseError}; /// A `DOCTYPE` token. // FIXME: already exists in Servo DOM -#[derive(PartialEq, Eq, Clone, Show)] +#[derive(PartialEq, Eq, Clone, Debug)] pub struct Doctype { pub name: Option, pub public_id: Option, @@ -50,20 +50,20 @@ impl Doctype { /// The tokenizer creates all attributes this way, but the tree /// builder will adjust certain attribute names inside foreign /// content (MathML, SVG). -#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug)] pub struct Attribute { pub name: QualName, pub value: String, } -#[derive(PartialEq, Eq, Hash, Copy, Clone, Show)] +#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)] pub enum TagKind { StartTag, EndTag, } /// A tag token. -#[derive(PartialEq, Eq, Clone, Show)] +#[derive(PartialEq, Eq, Clone, Debug)] pub struct Tag { pub kind: TagKind, pub name: Atom, @@ -88,7 +88,7 @@ impl Tag { } } -#[derive(PartialEq, Eq, Show)] +#[derive(PartialEq, Eq, Debug)] pub enum Token { DoctypeToken(Doctype), TagToken(Tag), diff --git a/src/tokenizer/states.rs b/src/tokenizer/states.rs index d263cec4..e99ad033 100644 --- a/src/tokenizer/states.rs +++ b/src/tokenizer/states.rs @@ -20,19 +20,19 @@ pub use self::RawKind::*; pub use self::AttrValueKind::*; pub use self::State::*; -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)] pub enum ScriptEscapeKind { Escaped, DoubleEscaped, } -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)] pub enum DoctypeIdKind { Public, System, } -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)] pub enum RawKind { Rcdata, Rawtext, @@ -40,14 +40,14 @@ pub enum RawKind { ScriptDataEscaped(ScriptEscapeKind), } -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)] pub enum AttrValueKind { Unquoted, SingleQuoted, DoubleQuoted, } -#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)] pub enum State { Data, Plaintext, diff --git a/src/tree_builder/actions.rs b/src/tree_builder/actions.rs index 0f1698cf..3def54fe 100644 --- a/src/tree_builder/actions.rs +++ b/src/tree_builder/actions.rs @@ -30,7 +30,7 @@ use util::str::to_escaped_string; use core::mem::replace; use core::iter::{Rev, Enumerate}; use core::slice; -use core::fmt::Show; +use core::fmt::Debug; use collections::vec::Vec; use collections::string::String; use std::borrow::Cow::Borrowed; @@ -60,7 +60,7 @@ pub enum PushFlag { // These go in a trait so that we can control visibility. pub trait TreeBuilderActions { - fn unexpected(&mut self, thing: &T) -> ProcessResult; + fn unexpected(&mut self, thing: &T) -> ProcessResult; fn assert_named(&mut self, node: Handle, name: Atom); fn clear_active_formatting_to_marker(&mut self); fn create_formatting_element_for(&mut self, tag: Tag) -> Handle; @@ -115,7 +115,7 @@ impl TreeBuilderActions where Handle: Clone, Sink: TreeSink, { - fn unexpected(&mut self, _thing: &T) -> ProcessResult { + fn unexpected(&mut self, _thing: &T) -> ProcessResult { self.sink.parse_error(format_if!( self.opts.exact_errors, "Unexpected token", diff --git a/src/tree_builder/interface.rs b/src/tree_builder/interface.rs index d03508fe..77c60985 100644 --- a/src/tree_builder/interface.rs +++ b/src/tree_builder/interface.rs @@ -24,7 +24,7 @@ pub use self::QuirksMode::{Quirks, LimitedQuirks, NoQuirks}; pub use self::NodeOrText::{AppendNode, AppendText}; /// A document's quirks mode. -#[derive(PartialEq, Eq, Copy, Clone, Hash, Show)] +#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)] pub enum QuirksMode { Quirks, LimitedQuirks, diff --git a/src/tree_builder/types.rs b/src/tree_builder/types.rs index 62812857..cfa1df3c 100644 --- a/src/tree_builder/types.rs +++ b/src/tree_builder/types.rs @@ -21,7 +21,7 @@ pub use self::Token::*; pub use self::ProcessResult::*; pub use self::FormatEntry::*; -#[derive(PartialEq, Eq, Copy, Clone, Show)] +#[derive(PartialEq, Eq, Copy, Clone, Debug)] pub enum InsertionMode { Initial, BeforeHtml, @@ -48,7 +48,7 @@ pub enum InsertionMode { AfterAfterFrameset, } -#[derive(PartialEq, Eq, Copy, Clone, Show)] +#[derive(PartialEq, Eq, Copy, Clone, Debug)] pub enum SplitStatus { NotSplit, Whitespace, @@ -57,7 +57,7 @@ pub enum SplitStatus { /// A subset/refinement of `tokenizer::Token`. Everything else is handled /// specially at the beginning of `process_token`. -#[derive(PartialEq, Eq, Clone, Show)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum Token { TagToken(Tag), CommentToken(String), diff --git a/src/util/str.rs b/src/util/str.rs index b89f6459..7bfc95f6 100644 --- a/src/util/str.rs +++ b/src/util/str.rs @@ -14,10 +14,10 @@ use collections::vec::Vec; use collections::string::String; #[cfg(not(for_c))] -use core::fmt::Show; +use core::fmt::Debug; #[cfg(not(for_c))] -pub fn to_escaped_string(x: &T) -> String { +pub fn to_escaped_string(x: &T) -> String { use collections::str::StrExt; use core::fmt::Writer;