Skip to content

Fix warnings #43

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
Apr 15, 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
6 changes: 4 additions & 2 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ extern crate test;
#[cfg(test)]
extern crate serialize;

pub use tokenizer::tokenize;
pub use parser::{parse_stylesheet_rules, parse_rule_list, parse_declaration_list,
pub use tokenizer::{tokenize, Tokenizer};
pub use parser::{parse_stylesheet_rules, StylesheetParser,
parse_rule_list, RuleListParser,
parse_declaration_list, DeclarationListParser,
parse_one_rule, parse_one_declaration, parse_one_component_value};
pub use from_bytes::{decode_stylesheet_bytes, parse_stylesheet_rules_from_bytes};
pub use color::{RGBA, Color, CurrentColor};
Expand Down
11 changes: 4 additions & 7 deletions parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ use std::ascii::StrAsciiExt;
use ast::*;


pub struct StylesheetParser<T>{ priv iter: T }
pub struct RuleListParser<T>{ priv iter: T }
pub struct DeclarationListParser<T>{ priv iter: T }

/// Parse top-level of a CSS stylesheet.
/// Return a Iterator<Result<Rule, SyntaxError>>
#[inline]
Expand Down Expand Up @@ -98,13 +102,6 @@ pub fn parse_one_component_value<T: Iterator<Node>>(mut iter: T)
// *********** End of public API ***********


// used in from_bytes.rs but not reexported in the crate top-level
pub struct StylesheetParser<T>{ iter: T }

struct RuleListParser<T>{ iter: T }
struct DeclarationListParser<T>{ iter: T }


// Work around "error: cannot borrow `*iter` as mutable more than once at a time"
// when using a normal for loop.
macro_rules! for_iter(
Expand Down
10 changes: 6 additions & 4 deletions tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use ast::*;

fn write_whole_file(path: &Path, data: &str) {
match File::open_mode(path, io::Open, io::Write) {
Ok(mut writer) => { writer.write(data.as_bytes()); },
Ok(mut writer) => { writer.write(data.as_bytes()).unwrap(); },
_ => fail!("could not open file"),
}
}
Expand Down Expand Up @@ -48,9 +48,11 @@ fn assert_json_eq(results: json::Json, expected: json::Json, message: ~str) {
expected_path.push("expected.json");
write_whole_file(&result_path, results);
write_whole_file(&expected_path, expected);
Process::status("colordiff", [~"-u1000", result_path.display().to_str(),
expected_path.display().to_str()]);
});
Process::status(
"colordiff",
[~"-u1000", result_path.display().to_str(), expected_path.display().to_str()]
).unwrap();
}).unwrap();

fail!(message)
}
Expand Down