Skip to content

Commit c953794

Browse files
jdmSimonSapin
authored andcommitted
Fix some uint warnings.
1 parent e14de8c commit c953794

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/ast.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub struct NumericValue {
1717

1818
#[derive(PartialEq, Show, Copy)]
1919
pub struct SourceLocation {
20-
pub line: uint, // First line is 1
21-
pub column: uint, // First character of a line is at column 1
20+
pub line: usize, // First line is 1
21+
pub column: usize, // First character of a line is at column 1
2222
}
2323

2424

@@ -122,7 +122,7 @@ pub enum ErrorReason {
122122

123123
impl fmt::Show for SyntaxError {
124124
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
125-
write!(f, "{}:{} {}", self.location.line, self.location.column, self.reason)
125+
write!(f, "{}:{} {:?}", self.location.line, self.location.column, self.reason)
126126
}
127127
}
128128

src/color.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use std::ascii::AsciiExt;
66
use std::fmt;
7-
use std::num::{Float, FloatMath};
7+
use std::num::Float;
88

99
use text_writer::{self, TextWriter};
1010

src/serializer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use ast::*;
1010
use ast::ComponentValue::*;
1111

1212

13-
pub trait ToCss where Self: Sized {
13+
pub trait ToCss {
1414
/// Serialize `self` in CSS syntax, writing to `dest`.
1515
fn to_css<W>(&self, dest: &mut W) -> text_writer::Result where W: TextWriter;
1616

src/tokenizer.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ mod bench_preprocess {
8383

8484
pub struct Tokenizer {
8585
input: String,
86-
length: uint, // All counted in bytes, not characters
87-
position: uint, // All counted in bytes, not characters
88-
line: uint,
89-
last_line_start: uint, // All counted in bytes, not characters
86+
length: usize, // All counted in bytes, not characters
87+
position: usize, // All counted in bytes, not characters
88+
line: usize,
89+
last_line_start: usize, // All counted in bytes, not characters
9090
}
9191

9292

@@ -99,7 +99,7 @@ impl Tokenizer {
9999
fn current_char(&self) -> char { self.char_at(0) }
100100

101101
#[inline]
102-
fn char_at(&self, offset: uint) -> char {
102+
fn char_at(&self, offset: usize) -> char {
103103
self.input.as_slice().char_at(self.position + offset)
104104
}
105105

@@ -581,8 +581,8 @@ fn consume_unicode_range(tokenizer: &mut Tokenizer) -> ComponentValue {
581581
&& is_match!(tokenizer.current_char(), '0'...'9' | 'A'...'F' | 'a'...'f') {
582582
hex.push(tokenizer.consume_char());
583583
}
584-
let max_question_marks = 6u - hex.len();
585-
let mut question_marks = 0u;
584+
let max_question_marks = 6us - hex.len();
585+
let mut question_marks = 0us;
586586
while question_marks < max_question_marks && !tokenizer.is_eof()
587587
&& tokenizer.current_char() == '?' {
588588
question_marks += 1;

0 commit comments

Comments
 (0)