servo: Merge #2323 - Fix some unused_mut/unused_result warnings (from Manishearth:warnings); r=Ms2ger

The `.encode()`s from where the unused_result warnings come from seem to wrap an `encode()` and return `Ok(())`.

They should probably bubble the result out.

Source-Repo: https://github.com/servo/servo
Source-Revision: edb1547502012c2145ce1411dc923720134bb8f1
This commit is contained in:
Manish Goregaokar 2014-05-05 06:19:21 -04:00
Родитель 1e040c311c
Коммит f7bf139ec7
3 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -138,8 +138,7 @@ impl<T> DerefMut<T> for Traceable<T> {
impl<S: Encoder<E>, E, T: Encodable<S, E>> Encodable<S, E> for Traceable<RefCell<T>> {
fn encode(&self, s: &mut S) -> Result<(), E> {
self.borrow().encode(s);
Ok(())
self.borrow().encode(s)
}
}

Просмотреть файл

@ -82,7 +82,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
// Step 1.
let mut doc = Document::new(&win.root_ref(), None, NonHTMLDocument, None).root();
// Step 2-3.
let mut maybe_elem = if qname.is_empty() {
let maybe_elem = if qname.is_empty() {
None
} else {
match doc.CreateElementNS(namespace, qname) {

Просмотреть файл

@ -73,8 +73,7 @@ impl<S: Encoder<E>, E> Encodable<S, E> for TrustedNodeAddress {
let node = addr as *Node as *mut Node;
unsafe {
JS::from_raw(node).encode(s)
};
Ok(())
}
}
}