Fix reported test-tidy errors

This fixes lines that were reported to have missing
space after a comma.
This commit is contained in:
Brandon Fairchild 2015-09-01 16:30:42 -04:00
parent 24bc6dfb52
commit d61a6e2161
13 changed files with 19 additions and 19 deletions

View file

@ -30,7 +30,7 @@ use util::geometry::Au;
pub trait FontHandleMethods {
fn new_from_template(fctx: &FontContextHandle, template: Arc<FontTemplateData>, pt_size: Option<Au>)
-> Result<Self,()>;
-> Result<Self, ()>;
fn template(&self) -> Arc<FontTemplateData>;
fn family_name(&self) -> String;
fn face_name(&self) -> String;

View file

@ -167,7 +167,7 @@ impl ApplicableDeclarationsCache {
/// An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.
pub struct StyleSharingCandidateCache {
cache: LRUCache<StyleSharingCandidate,()>,
cache: LRUCache<StyleSharingCandidate, ()>,
}
fn create_common_style_affecting_attributes_from_element(element: &LayoutElement)
@ -348,7 +348,7 @@ impl StyleSharingCandidateCache {
}
}
pub fn iter<'a>(&'a self) -> Iter<'a,(StyleSharingCandidate,())> {
pub fn iter<'a>(&'a self) -> Iter<'a, (StyleSharingCandidate, ())> {
self.cache.iter()
}

View file

@ -40,7 +40,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
let trait_def = TraitDef {
span: span,
attributes: Vec::new(),
path: ty::Path::new(vec!("dom","bindings","trace","JSTraceable")),
path: ty::Path::new(vec!("dom", "bindings", "trace", "JSTraceable")),
additional_bounds: Vec::new(),
generics: ty::LifetimeBounds::empty(),
methods: vec![
@ -48,7 +48,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
name: "trace",
generics: ty::LifetimeBounds::empty(),
explicit_self: ty::borrowed_explicit_self(),
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js","jsapi","JSTracer"))),
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js", "jsapi", "JSTracer"))),
ty::Raw(ast::MutMutable))),
ret_ty: ty::nil_ty(),
attributes: vec![quote_attr!(cx, #[inline])],

View file

@ -23,13 +23,13 @@ impl LintPass for BanPass {
}
fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
if match_ty_unwrap(ty, &["std","cell","Cell"])
if match_ty_unwrap(ty, &["std", "cell", "Cell"])
.and_then(|t| t.get(0))
.and_then(|t| match_ty_unwrap(&**t, &["dom", "bindings", "js", "JS"]))
.is_some() {
cx.span_lint(BANNED_TYPE, ty.span, "Banned type Cell<JS<T>> detected. Use MutHeap<JS<T>> instead")
}
if match_ty_unwrap(ty, &["std","cell","Cell"])
if match_ty_unwrap(ty, &["std", "cell", "Cell"])
.and_then(|t| t.get(0))
.and_then(|t| match_ty_unwrap(&**t, &["js", "jsval", "JSVal"]))
.is_some() {

View file

@ -60,7 +60,7 @@ impl DocumentLoader {
/// are lots of iframes.
pub fn new_with_task(resource_task: Arc<ResourceTask>,
data: Option<NotifierData>,
initial_load: Option<Url>,)
initial_load: Option<Url>)
-> DocumentLoader {
let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect();

View file

@ -1153,7 +1153,7 @@ impl Drop for CanvasRenderingContext2D {
}
}
pub fn parse_color(string: &str) -> Result<RGBA,()> {
pub fn parse_color(string: &str) -> Result<RGBA, ()> {
let mut parser = Parser::new(&string);
match CSSColor::parse(&mut parser) {
Ok(CSSColor::RGBA(rgba)) => {

View file

@ -1068,7 +1068,7 @@ impl XMLHttpRequest {
fn fetch(&self,
load_data: LoadData,
cors_request: Result<Option<CORSRequest>,()>,
cors_request: Result<Option<CORSRequest>, ()>,
global: GlobalRef) -> ErrorResult {
let cors_request = match cors_request {
Err(_) => {

View file

@ -158,7 +158,7 @@ impl<T: ClipboardProvider> TextInput<T> {
if begin.line != end.line {
let mut s = String::new();
s.push_str(&self.lines[begin.line][begin.index..]);
for (_, line) in self.lines.iter().enumerate().filter(|&(i,_)| begin.line < i && i < end.line) {
for (_, line) in self.lines.iter().enumerate().filter(|&(i, _)| begin.line < i && i < end.line) {
s.push_str("\n");
s.push_str(line);
}

View file

@ -826,7 +826,7 @@ pub mod specified {
}
/// Parses a time according to CSS-VALUES § 6.2.
fn parse_dimension(value: CSSFloat, unit: &str) -> Result<Time,()> {
fn parse_dimension(value: CSSFloat, unit: &str) -> Result<Time, ()> {
if unit.eq_ignore_ascii_case("s") {
Ok(Time(value))
} else if unit.eq_ignore_ascii_case("ms") {
@ -836,7 +836,7 @@ pub mod specified {
}
}
pub fn parse(input: &mut Parser) -> Result<Time,()> {
pub fn parse(input: &mut Parser) -> Result<Time, ()> {
match input.next() {
Ok(Token::Dimension(ref value, ref unit)) => {
Time::parse_dimension(value.value, &unit)

View file

@ -76,7 +76,7 @@ impl<K: Clone + PartialEq, V: Clone> LRUCache<K, V> {
self.entries[last_index].1.clone()
}
pub fn iter<'a>(&'a self) -> Iter<'a,(K, V)> {
pub fn iter<'a>(&'a self) -> Iter<'a, (K, V)> {
self.entries.iter()
}

View file

@ -26,7 +26,7 @@ pub enum OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
}
impl<T> OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
pub fn send(&self, value: T) -> Result<(),()> {
pub fn send(&self, value: T) -> Result<(), ()> {
match *self {
OptionalIpcSender::OutOfProcess(ref ipc_sender) => ipc_sender.send(value),
OptionalIpcSender::InProcess(ref sender) => sender.send(value).map_err(|_| ()),

View file

@ -435,7 +435,7 @@ pub fn from_cmdline_args(args: &[String]) {
opts.optflag("i", "nonincremental-layout", "Enable to turn off incremental layout.");
opts.optflag("", "no-ssl", "Disables ssl certificate verification.");
opts.optflagopt("", "userscripts",
"Uses userscripts in resources/user-agent-js, or a specified full path","");
"Uses userscripts in resources/user-agent-js, or a specified full path", "");
opts.optmulti("", "user-stylesheet",
"A user stylesheet to be added to every document", "file.css");
opts.optflag("z", "headless", "Headless mode");

View file

@ -169,7 +169,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
}
/// Parses a legacy color per HTML5 § 2.4.6. If unparseable, `Err` is returned.
pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
pub fn parse_legacy_color(mut input: &str) -> Result<RGBA, ()> {
// Steps 1 and 2.
if input.is_empty() {
return Err(())
@ -277,7 +277,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
alpha: 1.0,
});
fn hex(ch: char) -> Result<u8,()> {
fn hex(ch: char) -> Result<u8, ()> {
match ch {
'0'...'9' => Ok((ch as u8) - b'0'),
'a'...'f' => Ok((ch as u8) - b'a' + 10),
@ -286,7 +286,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
}
}
fn hex_string(string: &[u8]) -> Result<u8,()> {
fn hex_string(string: &[u8]) -> Result<u8, ()> {
match string.len() {
0 => Err(()),
1 => hex(string[0] as char),