Auto merge of #16495 - coalman:tidy-brace-alignment, r=emilio

Make tidy check that opening and closing braces that begin a line do …

…so with proper alignment.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #16486 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16495)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-19 03:06:31 -05:00 committed by GitHub
commit 195100f3ca
22 changed files with 150 additions and 130 deletions

View file

@ -728,7 +728,7 @@ impl<T: JSTraceable> RootableVec<T> {
RootableVec {
v: vec![],
}
}
}
}
/// A vector of items that are rooted for the lifetime 'a.

View file

@ -353,12 +353,12 @@ pub fn blob_parts_to_bytes(blobparts: Vec<BlobOrString>) -> Result<Vec<u8>, ()>
impl BlobMethods for Blob {
// https://w3c.github.io/FileAPI/#dfn-size
fn Size(&self) -> u64 {
match *self.blob_impl.borrow() {
BlobImpl::File(ref f) => f.size,
BlobImpl::Memory(ref v) => v.len() as u64,
BlobImpl::Sliced(ref parent, ref rel_pos) =>
rel_pos.to_abs_range(parent.Size() as usize).len() as u64,
}
match *self.blob_impl.borrow() {
BlobImpl::File(ref f) => f.size,
BlobImpl::Memory(ref v) => v.len() as u64,
BlobImpl::Sliced(ref parent, ref rel_pos) =>
rel_pos.to_abs_range(parent.Size() as usize).len() as u64,
}
}
// https://w3c.github.io/FileAPI/#dfn-type

View file

@ -37,7 +37,7 @@ impl DOMMatrixReadOnly {
reflector_: Reflector::new(),
matrix: DOMRefCell::new(matrix),
is2D: Cell::new(is2D),
}
}
}
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-dommatrixreadonly

View file

@ -2599,7 +2599,7 @@ impl Element {
self.has_attribute(&local_name!("href"))
},
_ => false,
}
}
}
/// Please call this method *only* for real click events

View file

@ -2383,7 +2383,7 @@ impl NodeMethods for Node {
// Step 2.
Node::namespace_to_string(Node::locate_namespace(self, prefix))
}
}
// https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
fn IsDefaultNamespace(&self, namespace: Option<DOMString>) -> bool {

View file

@ -457,7 +457,7 @@ impl<'a> Iterator for &'a TreeWalker {
// will probably be using a native Rust filter,
// which cannot produce an Err result.
unreachable!()
}
}
}
}

View file

@ -1795,7 +1795,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// WebGl conformance expects error with null programs. Check tests in get-active-test.html
self.webgl_error(InvalidValue);
return None;
}
}
};
match program.get_active_uniform(index) {
@ -1822,7 +1822,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// WebGl conformance expects error with null programs. Check tests in get-active-test.html
self.webgl_error(InvalidValue);
return None;
}
}
};
match program.get_active_attrib(index) {