Skip to content

Commit fc904df

Browse files
committed
Fix warnings
1 parent 5ecc433 commit fc904df

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ extern crate test;
1616
#[cfg(test)]
1717
extern crate serialize;
1818

19-
pub use tokenizer::tokenize;
20-
pub use parser::{parse_stylesheet_rules, parse_rule_list, parse_declaration_list,
19+
pub use tokenizer::{tokenize, Tokenizer};
20+
pub use parser::{parse_stylesheet_rules, StylesheetParser,
21+
parse_rule_list, RuleListParser,
22+
parse_declaration_list, DeclarationListParser,
2123
parse_one_rule, parse_one_declaration, parse_one_component_value};
2224
pub use from_bytes::{decode_stylesheet_bytes, parse_stylesheet_rules_from_bytes};
2325
pub use color::{RGBA, Color, CurrentColor};

parser.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ use std::ascii::StrAsciiExt;
2020
use ast::*;
2121

2222

23+
pub struct StylesheetParser<T>{ priv iter: T }
24+
pub struct RuleListParser<T>{ priv iter: T }
25+
pub struct DeclarationListParser<T>{ priv iter: T }
26+
2327
/// Parse top-level of a CSS stylesheet.
2428
/// Return a Iterator<Result<Rule, SyntaxError>>
2529
#[inline]
@@ -98,13 +102,6 @@ pub fn parse_one_component_value<T: Iterator<Node>>(mut iter: T)
98102
// *********** End of public API ***********
99103

100104

101-
// used in from_bytes.rs but not reexported in the crate top-level
102-
pub struct StylesheetParser<T>{ iter: T }
103-
104-
struct RuleListParser<T>{ iter: T }
105-
struct DeclarationListParser<T>{ iter: T }
106-
107-
108105
// Work around "error: cannot borrow `*iter` as mutable more than once at a time"
109106
// when using a normal for loop.
110107
macro_rules! for_iter(

tests.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use ast::*;
1616

1717
fn write_whole_file(path: &Path, data: &str) {
1818
match File::open_mode(path, io::Open, io::Write) {
19-
Ok(mut writer) => { writer.write(data.as_bytes()); },
19+
Ok(mut writer) => { writer.write(data.as_bytes()).unwrap(); },
2020
_ => fail!("could not open file"),
2121
}
2222
}
@@ -48,9 +48,11 @@ fn assert_json_eq(results: json::Json, expected: json::Json, message: ~str) {
4848
expected_path.push("expected.json");
4949
write_whole_file(&result_path, results);
5050
write_whole_file(&expected_path, expected);
51-
Process::status("colordiff", [~"-u1000", result_path.display().to_str(),
52-
expected_path.display().to_str()]);
53-
});
51+
Process::status(
52+
"colordiff",
53+
[~"-u1000", result_path.display().to_str(), expected_path.display().to_str()]
54+
).unwrap();
55+
}).unwrap();
5456
5557
fail!(message)
5658
}

0 commit comments

Comments
 (0)