Skip to content

Commit bb24d0e

Browse files
committed
Update to latest Rust
1 parent 01bbc87 commit bb24d0e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ast.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use std::slice;
77
use std::vec;
88

99

10-
#[deriving(Eq)]
10+
#[deriving(PartialEq)]
1111
pub struct NumericValue {
1212
pub representation: String,
1313
pub value: f64,
1414
pub int_value: Option<i64>,
1515
}
1616

1717

18-
#[deriving(Eq)]
18+
#[deriving(PartialEq)]
1919
pub struct SourceLocation {
2020
pub line: uint, // First line is 1
2121
pub column: uint, // First character of a line is at column 1
@@ -25,7 +25,7 @@ pub struct SourceLocation {
2525
pub type Node = (ComponentValue, SourceLocation); // TODO this is not a good name
2626

2727

28-
#[deriving(Eq)]
28+
#[deriving(PartialEq)]
2929
pub enum ComponentValue {
3030
// Preserved tokens.
3131
Ident(String),
@@ -69,49 +69,49 @@ pub enum ComponentValue {
6969
}
7070

7171

72-
#[deriving(Eq)]
72+
#[deriving(PartialEq)]
7373
pub struct Declaration {
7474
pub location: SourceLocation,
7575
pub name: String,
7676
pub value: Vec<ComponentValue>,
7777
pub important: bool,
7878
}
7979

80-
#[deriving(Eq)]
80+
#[deriving(PartialEq)]
8181
pub struct QualifiedRule {
8282
pub location: SourceLocation,
8383
pub prelude: Vec<ComponentValue>,
8484
pub block: Vec<Node>,
8585
}
8686

87-
#[deriving(Eq)]
87+
#[deriving(PartialEq)]
8888
pub struct AtRule {
8989
pub location: SourceLocation,
9090
pub name: String,
9191
pub prelude: Vec<ComponentValue>,
9292
pub block: Option<Vec<Node>>,
9393
}
9494

95-
#[deriving(Eq)]
95+
#[deriving(PartialEq)]
9696
pub enum DeclarationListItem {
9797
Declaration(Declaration),
9898
// A better idea for a name that means "at-rule" but is not "AtRule"?
9999
DeclAtRule(AtRule),
100100
}
101101

102-
#[deriving(Eq)]
102+
#[deriving(PartialEq)]
103103
pub enum Rule {
104104
QualifiedRule(QualifiedRule),
105105
AtRule(AtRule),
106106
}
107107

108-
#[deriving(Eq)]
108+
#[deriving(PartialEq)]
109109
pub struct SyntaxError {
110110
pub location: SourceLocation,
111111
pub reason: ErrorReason,
112112
}
113113

114-
#[deriving(Eq)]
114+
#[deriving(PartialEq)]
115115
pub enum ErrorReason {
116116
ErrEmptyInput, // Parsing a single "thing", found only whitespace.
117117
ErrExtraInput, // Found more non-whitespace after parsing a single "thing".

color.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::ascii::StrAsciiExt;
77
use ast::*;
88

99

10-
#[deriving(Clone, Eq)]
10+
#[deriving(Clone, PartialEq)]
1111
pub struct RGBA {
1212
// All in 0..1
1313
// Use f32 to try and match rust-azure’s AzFloat
@@ -17,7 +17,7 @@ pub struct RGBA {
1717
pub alpha: f32,
1818
}
1919

20-
#[deriving(Clone, Eq)]
20+
#[deriving(Clone, PartialEq)]
2121
pub enum Color {
2222
CurrentColor,
2323
RGBA(RGBA),

tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn next_component_value(tokenizer: &mut Tokenizer) -> Option<Node> {
101101
consume_comments(tokenizer);
102102
if tokenizer.is_eof() {
103103
if cfg!(test) {
104-
assert!(tokenizer.line == tokenizer.input.as_slice().split('\n').len(),
104+
assert!(tokenizer.line == tokenizer.input.as_slice().split('\n').count(),
105105
"The tokenizer is missing a tokenizer.new_line() call somewhere.")
106106
}
107107
return None

0 commit comments

Comments
 (0)